fix dialog to window using css
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
26af409a6e
commit
7ac240f6f2
|
@ -3,7 +3,7 @@
|
|||
color: #333;
|
||||
border-radius: 3px; box-shadow: 0 0 7px #888;
|
||||
padding: 15px;
|
||||
z-index: 1000;
|
||||
z-index: 10000;
|
||||
font-size: 100%;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
|
@ -12,6 +12,9 @@
|
|||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
max-height: calc(100% - 20px);
|
||||
max-width: calc(100% - 20px);
|
||||
overflow: auto;
|
||||
}
|
||||
.oc-dialog-title {
|
||||
background: #fff;
|
||||
|
|
|
@ -73,19 +73,8 @@
|
|||
return false;
|
||||
}
|
||||
});
|
||||
$(window).resize(function() {
|
||||
self.parent = self.$dialog.parent().length > 0 ? self.$dialog.parent() : $('body');
|
||||
var pos = self.parent.position();
|
||||
self.$dialog.css({
|
||||
width: Math.min(self.options.width, $(window).innerWidth() - 20 ),
|
||||
height: Math.min(self.options.height, $(window).innerHeight() - 20)
|
||||
});
|
||||
// set sizes of content
|
||||
self._setSizes();
|
||||
});
|
||||
|
||||
this._setOptions(this.options);
|
||||
$(window).trigger('resize');
|
||||
this._createOverlay();
|
||||
},
|
||||
_init: function() {
|
||||
|
|
Loading…
Reference in New Issue