Browse Source

#1968 Fixes undetachable scrollable modal in ideal circumstances (not inside a container with z-index)

pull/2034/head
jlukic 10 years ago
parent
commit
d9850a0ba6
3 changed files with 48 additions and 19 deletions
  1. 2
      RELEASE-NOTES.md
  2. 15
      src/definitions/modules/modal.js
  3. 50
      src/definitions/modules/modal.less

2
RELEASE-NOTES.md

@ -52,6 +52,8 @@
- **Grid** - Fixes colored grid columns not appearing when not nested in rows - **Grid** - Fixes colored grid columns not appearing when not nested in rows
- **Label** - Labels inside `header` now vertical align better by accounting for line height offset - **Label** - Labels inside `header` now vertical align better by accounting for line height offset
- **Message** - Message now uses `@lineHeight` from `site.variables` - **Message** - Message now uses `@lineHeight` from `site.variables`
- **Modal** - `scrollable modal` now correctly adds padding below modal
- **Modal** - Modal with `detachable: false` inside `ui sidebar` `pusher` element will now show correctly
- **Popup** - Fixes issue with `min-width` in firefox exceeding `max-width` causing element to not wrap correctly - **Popup** - Fixes issue with `min-width` in firefox exceeding `max-width` causing element to not wrap correctly
- **Table** - `very basic table` now works together with `padded table` - **Table** - `very basic table` now works together with `padded table`
- **Table** - Fix inheritance of text alignment and vertical alignment - **Table** - Fix inheritance of text alignment and vertical alignment

15
src/definitions/modules/modal.js

@ -117,6 +117,9 @@ $.fn.modal = function(parameters) {
module.verbose('Modal is detachable, moving content into dimmer'); module.verbose('Modal is detachable, moving content into dimmer');
$dimmable.dimmer('add content', $module); $dimmable.dimmer('add content', $module);
} }
else {
module.set.undetached();
}
$dimmer = $dimmable.dimmer('get dimmer'); $dimmer = $dimmable.dimmer('get dimmer');
}, },
id: function() { id: function() {
@ -580,7 +583,7 @@ $.fn.modal = function(parameters) {
else { 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 / 2) )
.css('height', module.cache.height + (settings.padding * 2) )
; ;
} }
}, },
@ -621,6 +624,9 @@ $.fn.modal = function(parameters) {
}) })
; ;
} }
},
undetached: function() {
$dimmable.addClass(className.undetached);
} }
}, },
@ -850,9 +856,10 @@ $.fn.modal.settings = {
notFound : 'The element you specified could not be found' notFound : 'The element you specified could not be found'
}, },
className : { className : {
active : 'active',
animating : 'animating',
scrolling : 'scrolling'
active : 'active',
animating : 'animating',
scrolling : 'scrolling',
undetached : 'undetached'
} }
}; };

50
src/definitions/modules/modal.less

@ -292,10 +292,23 @@
} }
} }
/*******************************
States
*******************************/
.ui.active.modal {
display: block;
}
/******************************* /*******************************
Variations
Variations
*******************************/ *******************************/
/*--------------
Scrolling
---------------*/
/* A modal that cannot fit on the page */ /* A modal that cannot fit on the page */
.scrolling.dimmable.dimmed { .scrolling.dimmable.dimmed {
overflow: hidden; overflow: hidden;
@ -307,12 +320,30 @@
.scrolling.dimmable > .dimmer { .scrolling.dimmable > .dimmer {
position: fixed; position: fixed;
} }
.ui.scrolling.modal {
position: static;
.modals.dimmer .ui.scrolling.modal {
position: static !important;
margin: @scrollingMargin auto !important; margin: @scrollingMargin auto !important;
} }
/* undetached scrolling */
.scrolling.undetached.dimmable.dimmed {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
.scrolling.undetached.dimmable.dimmed > .dimmer {
overflow: hidden;
}
.scrolling.undetached.dimmable .ui.scrolling.modal {
position: absolute;
left: 50%;
margin-top: @scrollingMargin !important;
}
/* Coupling with Sidebar */
.undetached.dimmable.dimmed > .pusher {
z-index: auto;
}
@media only screen and (max-width : @computerBreakpoint) { @media only screen and (max-width : @computerBreakpoint) {
.ui.scrolling.modal { .ui.scrolling.modal {
margin-top: @mobileScrollingMargin; margin-top: @mobileScrollingMargin;
@ -320,17 +351,6 @@
} }
} }
/*******************************
States
*******************************/
.ui.active.modal {
display: block;
}
/*******************************
Variations
*******************************/
/*-------------- /*--------------
Full Screen Full Screen

Loading…
Cancel
Save