From f4d79485d72354c4f0c88d5291c04ad1cbc0de0c Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 25 Nov 2016 20:49:50 +0100 Subject: fix styling of filepicker dialog Signed-off-by: Robin Appelman --- core/js/jquery.ocdialog.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/js') diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index 66c7d9bd7f1..9d1d58bdf64 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -180,7 +180,9 @@ content_height -= this.$buttonrow.outerHeight(true); } this.parent = this.$dialog.parent().length > 0 ? this.$dialog.parent() : $('body'); - content_height = Math.min(content_height, this.parent.height()-20); + 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', -- cgit v1.2.3 From a8ce10bba33710d4b72922f6ee8856d4c25cdb32 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 25 Nov 2016 20:50:09 +0100 Subject: limit filepicker height to screen Signed-off-by: Robin Appelman --- core/js/oc-dialogs.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'core/js') diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index 3b5c1ae7199..26f06cfbb27 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -233,7 +233,7 @@ var OCdialogs = { closeOnEscape: true, // max-width of 600 width: Math.min((4/5)*$(document).width(), 600), - height: 420, + height: Math.min((4 / 5) * $(document).height(), 500), modal: modal, buttons: buttonlist, close: function() { @@ -253,10 +253,6 @@ var OCdialogs = { } else { buttonEnableDisable.prop("disabled", true); } - - if (!OC.Util.hasSVGSupport()) { - OC.Util.replaceSVG(self.$filePicker.parent()); - } }) .fail(function(status, error) { // If the method is called while navigating away @@ -835,9 +831,6 @@ var OCdialogs = { }); self.$filelist.removeClass('icon-loading'); - if (!OC.Util.hasSVGSupport()) { - OC.Util.replaceSVG(self.$filePicker.find('.dirtree')); - } }); }, /** -- cgit v1.2.3 From 26af409a6e73b02a908ec2e799252ad3bd627f4d Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 28 Nov 2016 13:44:27 +0100 Subject: center dialog using css Signed-off-by: Robin Appelman --- core/css/jquery.ocdialog.css | 3 +++ core/js/jquery.ocdialog.js | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'core/js') diff --git a/core/css/jquery.ocdialog.css b/core/css/jquery.ocdialog.css index 939c44f4d4e..7a7695a4e89 100644 --- a/core/css/jquery.ocdialog.css +++ b/core/css/jquery.ocdialog.css @@ -9,6 +9,9 @@ -moz-box-sizing: border-box; box-sizing: border-box; min-width: 200px; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); } .oc-dialog-title { background: #fff; diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index 9d1d58bdf64..1f02a372345 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -77,8 +77,6 @@ self.parent = self.$dialog.parent().length > 0 ? self.$dialog.parent() : $('body'); var pos = self.parent.position(); self.$dialog.css({ - left: pos.left + ($(window).innerWidth() - self.$dialog.outerWidth())/2, - top: pos.top + ($(window).innerHeight() - self.$dialog.outerHeight())/2, width: Math.min(self.options.width, $(window).innerWidth() - 20 ), height: Math.min(self.options.height, $(window).innerHeight() - 20) }); -- cgit v1.2.3 From 7ac240f6f20688fc6d944c743986c389412dd1b7 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 28 Nov 2016 13:49:45 +0100 Subject: fix dialog to window using css Signed-off-by: Robin Appelman --- core/css/jquery.ocdialog.css | 5 ++++- core/js/jquery.ocdialog.js | 11 ----------- 2 files changed, 4 insertions(+), 12 deletions(-) (limited to 'core/js') diff --git a/core/css/jquery.ocdialog.css b/core/css/jquery.ocdialog.css index 7a7695a4e89..72253a6549c 100644 --- a/core/css/jquery.ocdialog.css +++ b/core/css/jquery.ocdialog.css @@ -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; diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index 1f02a372345..449c97ca01b 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -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() { -- cgit v1.2.3 From b2b9abfa33f75f779e62f8f2554e2159b3bca90d Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 28 Nov 2016 14:05:46 +0100 Subject: move more sizing logic to css Signed-off-by: Robin Appelman --- core/css/jquery.ocdialog.css | 8 ++++++-- core/css/styles.css | 2 +- core/js/jquery.ocdialog.js | 23 ++++++----------------- core/js/oc-dialogs.js | 4 ++-- 4 files changed, 15 insertions(+), 22 deletions(-) (limited to 'core/js') diff --git a/core/css/jquery.ocdialog.css b/core/css/jquery.ocdialog.css index 72253a6549c..487bc1c4f69 100644 --- a/core/css/jquery.ocdialog.css +++ b/core/css/jquery.ocdialog.css @@ -26,8 +26,8 @@ background: transparent; right: 0; bottom: 0; - padding: 20px; - padding-bottom: 10px; + padding: 10px; + padding-bottom: 0; box-sizing: border-box; width: 100%; background-image: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 1)); @@ -70,3 +70,7 @@ top: 0; left: 0; width: 100%; height: 100%; } + +.oc-dialog-content { + width: 100%; +} diff --git a/core/css/styles.css b/core/css/styles.css index 14bb75de879..5a5432cbf16 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -773,7 +773,7 @@ a.bookmarklet { background-color:#ddd; border:1px solid #ccc; padding:5px;paddin box-sizing: border-box; display: inline-block; overflow-y: auto; - height: calc(100% + 20px); /** overflow under the button row */ + height: 100%; /** overflow under the button row */ width: 100%; padding-bottom: 55px; } diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index 449c97ca01b..b54cce2c0ca 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -159,27 +159,16 @@ $.Widget.prototype._setOptions.apply(this, arguments); }, _setSizes: function() { - var content_height = this.$dialog.height(); + var lessHeight = 0; if(this.$title) { - content_height -= this.$title.outerHeight(true); + lessHeight += this.$title.outerHeight(true); } 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() { if(!this.options.modal) { diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index 26f06cfbb27..a9547b1adc5 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -232,8 +232,8 @@ var OCdialogs = { self.$filePicker.ocdialog({ closeOnEscape: true, // 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, buttons: buttonlist, close: function() { -- cgit v1.2.3