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` - **Form** - `info message` are no longer hidden by default inside `ui form`
- **Dropdown** - Upward dropdown now has upward arrow icon - **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 - **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 - **Steps** - Fixed bug where evenly divided steps were no longer fluid
- **Transition** - Fixes bug where `moduleNamespace` was being omitted - **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 - **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: { can: {
fit: function() { 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() { 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'); module.debug('Modal is taller than page content, resizing page height');
$body $body
.css('height', module.cache.height + settings.padding)
.css('height', module.cache.height + (settings.padding / 2) )
; ;
} }
else {
$body.css('height', '');
}
}, },
active: function() { active: function() {
$module.addClass(className.active); $module.addClass(className.active);
@ -823,7 +823,7 @@ $.fn.modal.settings = {
offset : 0, offset : 0,
transition : 'scale', transition : 'scale',
padding : 30,
padding : 50,
onShow : function(){}, onShow : function(){},
onHide : function(){}, onHide : function(){},

Loading…
Cancel
Save