From ddc5f636bf89f15ed69d6701814ac7c942706f4d Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 5 Sep 2014 13:11:00 -0400 Subject: [PATCH] Fixes issue with modal sometimes caching sizes when hidden #895, #951 --- src/definitions/modules/modal.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index f0026152d..ed739695f 100755 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -436,13 +436,18 @@ $.fn.modal = function(parameters) { }, cacheSizes: function() { - module.cache = { - pageHeight : $(document).outerHeight(), - height : $module.outerHeight() + settings.offset, - contextHeight : (settings.context == 'body') - ? $(window).height() - : $dimmable.height() - }; + var + modalHeight = $module.outerHeight() + ; + if(modalHeight !== 0) { + module.cache = { + pageHeight : $(document).outerHeight(), + height : modalHeight + settings.offset, + contextHeight : (settings.context == 'body') + ? $(window).height() + : $dimmable.height() + }; + } module.debug('Caching modal and container sizes', module.cache); },