js/components/showcase.js
function(width, height) {
        var gutter = (this.options.gutter * 2),
            wWidth = $(window).width() - gutter,
            wHeight = $(window).height() - gutter,
            ratio,
            diff;

        // Resize if the width is larger
        if (width > wWidth) {
            ratio = (width / height);
            diff = (width - wWidth);

            width = wWidth;
            height -= Math.round(diff / ratio);
        }

        // Resize again if the height is larger
        if (height > wHeight) {
            ratio = (height / width);
            diff = (height - wHeight);

            width -= Math.round(diff / ratio);
            height = wHeight;
        }

        this.items.css({
            width: width,
            height: height
        });
    }
function(width, height) {
        var gutter = (this.options.gutter * 2),
            wWidth = $(window).width() - gutter,
            wHeight = $(window).height() - gutter,
            ratio,
            diff;

        // Resize if the width is larger
        if (width > wWidth) {
            ratio = (width / height);
            diff = (width - wWidth);

            width = wWidth;
            height -= Math.round(diff / ratio);
        }

        // Resize again if the height is larger
        if (height > wHeight) {
            ratio = (height / width);
            diff = (height - wHeight);

            width -= Math.round(diff / ratio);
            height = wHeight;
        }

        this.items.css({
            width: width,
            height: height
        });
    }
function ( width , height ) { var gutter = ( this . options . gutter * 2 ) , wWidth = $ ( window ) . width ( ) - gutter , wHeight = $ ( window ) . height ( ) - gutter , ratio , diff ; // Resize if the width is larger if ( width > wWidth ) { ratio = ( width / height ) ; diff = ( width - wWidth ) ; width = wWidth ; height -= Math . round ( diff / ratio ) ; } // Resize again if the height is larger if ( height > wHeight ) { ratio = ( height / width ) ; diff = ( height - wHeight ) ; width -= Math . round ( diff / ratio ) ; height = wHeight ; } this . items . css ( { width : width , height : height } ) ; }
Resize the showcase modal when it is larger than the current viewport.

@private
@param {Number} width
@param {Number} height
Resize the showcase modal when it is larger than the current viewport .