<commit_before>
LightPlayer = function () {};

LightPlayer.prototype = {
    open: function ( json ) {
        // Barramento principal pela qual todos os modulos se comunicam
        this.bus  = $( {} );
        this.json = json;

        this._render();
        this._addMods();
        this._addEvents();

        this._animateIn();
    },

    close: function () {
        var that = this;

        this._animateOut( function () {
            that.domRoot.remove(); 
        });

        $( document ).unbind( 'keydown.lightplayer' );
    },

    add: function ( mod ) {
        var json = $.extend( true, {}, this.json );

        this.domRoot.find( 'div.widget' ).append( mod.init( this.bus, json ) ); 
    },

    // private

    _addEvents: function () {
        var that = this;

        this.bus.bind( 'lightplayer-close', function () {
            that.close();
        } );

        this.domRoot.delegate( 'div.widget-container', 'click', function ( evt ) {
            if ( evt.target === this ) {
                that.close();
            }
        } );

        $( document ).bind( 'keydown.lightplayer', function ( evt ) {
            if ( evt.which === 27 ) {
                that.close();
            }
        } );
    },
    
    _addMods: function () {
        this.add( new Header() );
        this.add( new Stage() );
        this.add( new Info() );
        this.add( new Social() );
    },

    _animateIn: function () {
        var that = this,
            onTransitionEnd = this._getTransitionEndEvent(),
            divOverlay = this.domRoot.find( 'div.widget-overlay' ),
            divWidget = this.domRoot.find( 'div.widget' );

        this._disablePageScroll();

        divOverlay.bind( onTransitionEnd, function () {
            divWidget.bind( onTransitionEnd, function () {
                /* Firefox bugfix: Flash + css transform doesn't get along very well */
                divWidget.css( '-moz-transform', 'none' );

                that.bus.trigger( 'lightplayer-opened' );

                divWidget.unbind( onTransitionEnd );
            } );

            divWidget.addClass( 'visible' );
            
            divOverlay.unbind( onTransitionEnd );
        } );

        divOverlay.addClass( 'visible' );
        <commit_msg>Lightplayer: animação consertada com .width().<commit_after>
LightPlayer = function () {};

LightPlayer.prototype = {
    open: function ( json ) {
        // Barramento principal pela qual todos os modulos se comunicam
        this.bus  = $( {} );
        this.json = json;

        this._render();
        this._addMods();
        this._addEvents();
        
        this._animateIn();
    },

    close: function () {
        var that = this;

        this._animateOut( function () {
            that.domRoot.remove(); 
        });

        $( document ).unbind( 'keydown.lightplayer' );
    },

    add: function ( mod ) {
        var json = $.extend( true, {}, this.json );

        this.domRoot.find( 'div.widget' ).append( mod.init( this.bus, json ) ); 
    },

    // private

    _addEvents: function () {
        var that = this;

        this.bus.bind( 'lightplayer-close', function () {
            that.close();
        } );

        this.domRoot.delegate( 'div.widget-container', 'click', function ( evt ) {
            if ( evt.target === this ) {
                that.close();
            }
        } );

        $( document ).bind( 'keydown.lightplayer', function ( evt ) {
            if ( evt.which === 27 ) {
                that.close();
            }
        } );
    },
    
    _addMods: function () {
        this.add( new Header() );
        this.add( new Stage() );
        this.add( new Info() );
        this.add( new Social() );
    },

    _animateIn: function () {
        var that = this,
            onTransitionEnd = this._getTransitionEndEvent(),
            divOverlay = this.domRoot.find( 'div.widget-overlay' ),
            divWidget = this.domRoot.find( 'div.widget' );

        this._disablePageScroll();

        divOverlay.bind( onTransitionEnd, function () {
            divWidget.bind( onTransitionEnd, function () {
                /* Firefox bugfix: Flash + css transform doesn't get along very well */
                divWidget.css( '-moz-transform', 'none' );

                that.bus.trigger( 'lightplayer-opened' );

                divWidget.unbind( onTransitionEnd );
            } );

            divWidget.addClass( 'visible' );
            
            divOverlay.unbind( onTransitionEnd );
        } );
        
        // CSS3 has problems with recentlya added dom elements
        // Needs to call .width() to force reflow.
        divOverlay.width();
        divOverlay.addClass( 'visible' );
        
{'fraction_non_alphanumeric': 0.13965772237481514, 'fraction_numerical': 0.0010564124234100994, 'mean_word_length': 1.6010989010989012, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4806436', 'n_tokens_mistral': 1346, 'n_tokens_neox': 1293, 'n_words': 286}