ui.js
/**
     * Draws or updated the module's grid with specified HTML after animation is complete. All modules should call this method to allow animations to blend in.
     * @param {string} grid - Id of the element to draw in (innerHTML)
     * @param {string} html - String containing the HTML to draw
     * @param {func} callback - After the HTML is drawn an before the welcome animation this method will be called (should be used to call functions that depend on the HTML to exist)
     */
Draws or updated the module's grid with specified HTML after animation is complete. All modules should call this method to allow animations to blend in.
@param {string} grid - Id of the element to draw in (innerHTML)
@param {string} html - String containing the HTML to draw
@param {func} callback - After the HTML is drawn an before the welcome animation this method will be called (should be used to call functions that depend on the HTML to exist)
Draws or updated the module ' s grid with specified HTML after animation is complete . All modules should call this method to allow animations to blend in . @param { string } grid - Id of the element to draw in ( innerHTML ) @param { string } html - String containing the HTML to draw @param { func } callback - After the HTML is drawn an before the welcome animation this method will be called ( should be used to call functions that depend on the HTML to exist )
draw(grid, html, callback) {
        var elapsed = performance.now() - this.animationStart;
        if (elapsed < this.animationTime) { 
            setTimeout(function () {
                document.getElementById(grid).innerHTML = html;
                if (callback != undefined) callback();
                if (this.animationCallback != null) this.animationCallback();
                this.animationCallback = null;
                if (this.drawCallback != null) this.drawCallback();
                this.welcomeAnimation();
            }.bind(this), this.animationTime - elapsed);
        } else { 
            document.getElementById(grid).innerHTML = html;
            if (callback != undefined) callback();
            if (this.animationCallback != null) this.animationCallback();
            this.animationCallback = null;
            if (this.drawCallback != null) this.drawCallback();
            this.welcomeAnimation();
        }
    }
draw ( grid , html , callback ) { var elapsed = performance . now ( ) - this . animationStart ; if ( elapsed < this . animationTime ) { setTimeout ( function ( ) { document . getElementById ( grid ) . innerHTML = html ; if ( callback != undefined ) callback ( ) ; if ( this . animationCallback != null ) this . animationCallback ( ) ; this . animationCallback = null ; if ( this . drawCallback != null ) this . drawCallback ( ) ; this . welcomeAnimation ( ) ; } . bind ( this ) , this . animationTime - elapsed ) ; } else { document . getElementById ( grid ) . innerHTML = html ; if ( callback != undefined ) callback ( ) ; if ( this . animationCallback != null ) this . animationCallback ( ) ; this . animationCallback = null ; if ( this . drawCallback != null ) this . drawCallback ( ) ; this . welcomeAnimation ( ) ; } }
Draws or updated the module's grid with specified HTML after animation is complete.
Draws or updated the module ' s grid with specified HTML after animation is complete .
// Not enought time has passed to complete animation // The async request has taken longer than the animation. Draw now!