Browse Source

Backport of modal positioning fix

pull/1076/head
jlukic 10 years ago
parent
commit
9936cd02c6
1 changed files with 15 additions and 8 deletions
  1. 23
      src/modules/modal.js

23
src/modules/modal.js

@ -456,17 +456,24 @@ $.fn.modal = function(parameters) {
}
},
cacheSizes: function() {
module.cache = {
pageHeight : $body.outerHeight(),
height : $module.outerHeight() + settings.offset,
contextHeight : (settings.context == 'body')
? $(window).height()
: $dimmable.height()
};
module.debug('Caching modal and container sizes', module.cache);
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);
}
},
can: {
fit: function() {
return (module.cache.height < module.cache.contextHeight);

Loading…
Cancel
Save