Browse Source

move more sizing logic to css

Signed-off-by: Robin Appelman <robin@icewind.nl>
tags/v11.0RC2
Robin Appelman 7 years ago
parent
commit
b2b9abfa33
No account linked to committer's email address
4 changed files with 15 additions and 22 deletions
  1. 6
    2
      core/css/jquery.ocdialog.css
  2. 1
    1
      core/css/styles.css
  3. 6
    17
      core/js/jquery.ocdialog.js
  4. 2
    2
      core/js/oc-dialogs.js

+ 6
- 2
core/css/jquery.ocdialog.css View File

background: transparent; background: transparent;
right: 0; right: 0;
bottom: 0; bottom: 0;
padding: 20px;
padding-bottom: 10px;
padding: 10px;
padding-bottom: 0;
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
background-image: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 1)); background-image: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
top: 0; left: 0; top: 0; left: 0;
width: 100%; height: 100%; width: 100%; height: 100%;
} }

.oc-dialog-content {
width: 100%;
}

+ 1
- 1
core/css/styles.css View File

box-sizing: border-box; box-sizing: border-box;
display: inline-block; display: inline-block;
overflow-y: auto; overflow-y: auto;
height: calc(100% + 20px); /** overflow under the button row */
height: 100%; /** overflow under the button row */
width: 100%; width: 100%;
padding-bottom: 55px; padding-bottom: 55px;
} }

+ 6
- 17
core/js/jquery.ocdialog.js View File

$.Widget.prototype._setOptions.apply(this, arguments); $.Widget.prototype._setOptions.apply(this, arguments);
}, },
_setSizes: function() { _setSizes: function() {
var content_height = this.$dialog.height();
var lessHeight = 0;
if(this.$title) { if(this.$title) {
content_height -= this.$title.outerHeight(true);
lessHeight += this.$title.outerHeight(true);
} }
if(this.$buttonrow) { if(this.$buttonrow) {
content_height -= this.$buttonrow.outerHeight(true);
}
this.parent = this.$dialog.parent().length > 0 ? this.$dialog.parent() : $('body');
if (this.parent.height() > 0) {
content_height = Math.min(content_height, this.parent.height() - 20);
}
if (content_height> 0) {
this.element.css({
height: content_height + 'px',
width: this.$dialog.innerWidth() - 30 + 'px'
});
} else {
this.element.css({
width : this.$dialog.innerWidth() - 30 + 'px'
});
lessHeight += this.$buttonrow.outerHeight(true);
} }
this.element.css({
'height': 'calc(100% - ' + lessHeight + 'px)'
});
}, },
_createOverlay: function() { _createOverlay: function() {
if(!this.options.modal) { if(!this.options.modal) {

+ 2
- 2
core/js/oc-dialogs.js View File

self.$filePicker.ocdialog({ self.$filePicker.ocdialog({
closeOnEscape: true, closeOnEscape: true,
// max-width of 600 // max-width of 600
width: Math.min((4/5)*$(document).width(), 600),
height: Math.min((4 / 5) * $(document).height(), 500),
width: 600,
height: 500,
modal: modal, modal: modal,
buttons: buttonlist, buttons: buttonlist,
close: function() { close: function() {

Loading…
Cancel
Save