Giter Club home page Giter Club logo

proto-facebox's People

Contributors

dcrall avatar

Stargazers

 avatar  avatar

Watchers

 avatar

proto-facebox's Issues

Why do we invoke show on all children of $('facebox_content')?

This may be an artifact of the original Facebox, but I'm not sure why Facebox.reveal() invokes show() on all the children of facebox_content instead of just showing facebox_content itself. Certainly for things like MAUI's list options, this is problematic.

 reveal: function(data, klass){
    this.loading();
    $('facebox').fire('facebox:beforeReveal');

    var faceboxContent = $('facebox_content');
    if (klass) faceboxContent.addClassName(klass);
    faceboxContent.update(data);

    $$('#facebox .loading').invoke('remove');

    // Why show all children?
    $('facebox_content').childElements().invoke('show');

    this.setLocation();
    this.open();        

    $('facebox').fire('facebox:reveal');
    $('facebox').fire('facebox:afterReveal');
}

Large image doesn't center properly

For some reason, Prototype doesn't calculate the width correctly on a large image on the initial reveal. If the window is resized, the facebox centers correctly. Use the following logging code:

setLocation: function(){
    var pageScroll = document.viewport.getScrollOffsets();
    var vertical_margin = pageScroll.top + (document.viewport.getHeight()/ this.settings.v_margin_divisor);
    var left_offset = (document.viewport.getWidth()/2) - ($('facebox').getWidth()/2);

    console.log('Viewport width: ' + document.viewport.getWidth());
    console.log('Facebox width: ' + $('facebox').getWidth());
    console.log('Top: ' + vertical_margin);
    console.log('Left: ' + left_offset);

    $('facebox').setStyle({
        'top': vertical_margin + 'px',
        'left': left_offset + 'px'
    });
},

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.