Browse Source

#1804, Fix resize logic for scrolling modal to include padding

pull/1785/head
jlukic 9 years ago
parent
commit
dada633c7f
2 changed files with 8 additions and 7 deletions
  1. 1
      RELEASE-NOTES.md
  2. 14
      src/definitions/modules/modal.js

1
RELEASE-NOTES.md

@ -52,6 +52,7 @@
- **Form** - `info message` are no longer hidden by default inside `ui form`
- **Dropdown** - Upward dropdown now has upward arrow icon
- **Icon** - `external link` and `external link square` has been renamed to `external icon` to no longer receive `link` styles by default
- **Modal** - Modal now swaps to `scrolling modal` when `close icon` no longer can be displayed, instead of modal `content`
- **Steps** - Fixed bug where evenly divided steps were no longer fluid
- **Transition** - Fixes bug where `moduleNamespace` was being omitted
- **Transition** - Transitions with direction now use word order dependency to prevent conflict with component directions, for example `bottom left popup slide down in transition

14
src/definitions/modules/modal.js

@ -526,7 +526,7 @@ $.fn.modal = function(parameters) {
can: {
fit: function() {
return (module.cache.height < module.cache.contextHeight);
return ( ( module.cache.height + (settings.padding * 2) ) < module.cache.contextHeight);
}
},
@ -570,15 +570,15 @@ $.fn.modal = function(parameters) {
}
},
screenHeight: function() {
if(module.cache.height > module.cache.pageHeight) {
if( module.can.fit() ) {
$body.css('height', '');
}
else {
module.debug('Modal is taller than page content, resizing page height');
$body
.css('height', module.cache.height + settings.padding)
.css('height', module.cache.height + (settings.padding / 2) )
;
}
else {
$body.css('height', '');
}
},
active: function() {
$module.addClass(className.active);
@ -823,7 +823,7 @@ $.fn.modal.settings = {
offset : 0,
transition : 'scale',
padding : 30,
padding : 50,
onShow : function(){},
onHide : function(){},

Loading…
Cancel
Save