Browse Source

Popup z-index going way up #1668. Add z-index variable for modal

pull/1698/merge
jlukic 9 years ago
parent
commit
671948c252
5 changed files with 14 additions and 7 deletions
  1. 2
      src/definitions/modules/modal.less
  2. 7
      src/definitions/modules/popup.js
  3. 5
      src/definitions/modules/popup.less
  4. 1
      src/themes/default/modules/modal.variables
  5. 6
      src/themes/default/modules/popup.variables

2
src/definitions/modules/modal.less

@ -25,7 +25,7 @@
.ui.modal { .ui.modal {
display: none; display: none;
position: fixed; position: fixed;
z-index: 1001;
z-index: @zIndex;
top: 50%; top: 50%;
left: 50%; left: 50%;

7
src/definitions/modules/popup.js

@ -103,18 +103,18 @@ $.fn.popup = function(parameters) {
refresh: function() { refresh: function() {
if(settings.popup) { if(settings.popup) {
$popup = $(settings.popup);
$popup = $(settings.popup).eq(0);
} }
else { else {
if(settings.inline) { if(settings.inline) {
$popup = $target.next(selector.popup);
$popup = $target.next(selector.popup).eq(0);
} }
} }
if(settings.popup) { if(settings.popup) {
$popup.addClass(className.loading); $popup.addClass(className.loading);
$offsetParent = module.get.offsetParent(); $offsetParent = module.get.offsetParent();
$popup.removeClass(className.loading); $popup.removeClass(className.loading);
if(module.has.popup() && module.get.offsetParent($popup)[0] !== $offsetParent[0]) {
if(settings.movePopup && module.has.popup() && module.get.offsetParent($popup)[0] !== $offsetParent[0]) {
module.debug('Moving popup to the same offset parent as activating element'); module.debug('Moving popup to the same offset parent as activating element');
$popup $popup
.detach() .detach()
@ -1087,6 +1087,7 @@ $.fn.popup.settings = {
}, },
setFluidWidth : true, setFluidWidth : true,
movePopup : true,
target : false, target : false,
popup : false, popup : false,

5
src/definitions/modules/popup.less

@ -18,6 +18,7 @@
@import '../../theme.config'; @import '../../theme.config';
/******************************* /*******************************
Popup Popup
*******************************/ *******************************/
@ -27,6 +28,10 @@
position: absolute; position: absolute;
top: 0px; top: 0px;
right: 0px; right: 0px;
/* Fixes content being squished when inline (moz only) */
min-width: -moz-max-content;
z-index: @zIndex; z-index: @zIndex;
border: @border; border: @border;

1
src/themes/default/modules/modal.variables

@ -5,6 +5,7 @@
@background: @white; @background: @white;
@border: none; @border: none;
@width: 90%; @width: 90%;
@zIndex: 1001;
@xOffset: -(@width / 2); @xOffset: -(@width / 2);
@borderRadius: @defaultBorderRadius; @borderRadius: @defaultBorderRadius;
@boxShadow: 0 1px 4px 1px rgba(0, 0, 0, 0.3); @boxShadow: 0 1px 4px 1px rgba(0, 0, 0, 0.3);

6
src/themes/default/modules/popup.variables

@ -6,7 +6,7 @@
Element Element
--------------------*/ --------------------*/
@zIndex: 900;
@zIndex: 1900;
@background: @white; @background: @white;
@maxWidth: 250px; @maxWidth: 250px;
@ -60,8 +60,8 @@
Coupling Coupling
--------------------*/ --------------------*/
/* (padding * @medium) */
@nestedGridMargin: -0.7rem -0.875rem;
/* Grid Inside Popup */
@nestedGridMargin: -0.7rem -0.875rem; /* (padding * @medium) */
@nestedGridWidth: ~"calc(100% + 1.75rem)"; @nestedGridWidth: ~"calc(100% + 1.75rem)";
/*------------------- /*-------------------

Loading…
Cancel
Save