From b2f7db87e142696ff2fec56ce8187454f1fe7e51 Mon Sep 17 00:00:00 2001 From: Sylwester Date: Mon, 28 Oct 2013 18:30:40 +0100 Subject: [PATCH] Config height value used prior to CSS value The height set in config should be used instead of waiting for the CSS. Sometimes the gallery may be hidden, then the height retrieved is 0, causing a fatal error. To solve this issue, config value should be used if present. --- src/galleria.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/galleria.js b/src/galleria.js index 0bca30fb..c994317b 100644 --- a/src/galleria.js +++ b/src/galleria.js @@ -2695,10 +2695,10 @@ Galleria.prototype = { self._userRatio = self._ratio = self._options.height; } - // the gallery is ready, let's just wait for the css + // the gallery is ready, let's just wait for the css or use config by default var num = { width: 0, height: 0 }; var testHeight = function() { - return self.$( 'stage' ).height(); + return self._options.height || self.$( 'stage' ).height(); }; // check container and thumbnail height @@ -6963,4 +6963,4 @@ $.fn.galleria = function( options ) { // phew -}( jQuery ) ); \ No newline at end of file +}( jQuery ) );