From 32c1b46d30a9baa768c00e16fe8ae63aceb9f2ed Mon Sep 17 00:00:00 2001 From: Felix Heidecke Date: Fri, 27 Oct 2017 16:25:50 +0200 Subject: [PATCH 1/2] Rework permissions in UX friendlier radio-button style, improve modal behavior on mobile devices. --- apps/files_sharing/css/sharetabview.css | 3 - core/css/jquery.ocdialog.css | 23 +++++-- core/js/jquery.ocdialog.js | 38 ----------- core/js/sharedialoglinkshareview.js | 86 ++++++++++--------------- 4 files changed, 52 insertions(+), 98 deletions(-) diff --git a/apps/files_sharing/css/sharetabview.css b/apps/files_sharing/css/sharetabview.css index a1a6cb137db3..3c24e5fb097a 100644 --- a/apps/files_sharing/css/sharetabview.css +++ b/apps/files_sharing/css/sharetabview.css @@ -254,9 +254,6 @@ } /* ---------------------------------------------------- PUBLIC LINK MODAL --- */ -.public-link-modal { - width: 340px; -} .public-link-modal--item { margin-bottom: 20px; } diff --git a/core/css/jquery.ocdialog.css b/core/css/jquery.ocdialog.css index d37fdf548d4d..90b261beefed 100644 --- a/core/css/jquery.ocdialog.css +++ b/core/css/jquery.ocdialog.css @@ -8,13 +8,28 @@ -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; - min-width: 200px; + min-width: 340px; +} + +@media (max-width: 512px) { + .oc-dialog { + position: absolute; + top: 55px; + right: 10px; + left: 10px; + } +} +@media (min-width: 513px) { /* Center positioning */ - left: 50%; - top: 50%; - transform: translate(-50%,-50%); + .oc-dialog { + position: fixed; + left: 50%; + top: 50%; + transform: translate(-50%,-50%); + } } + .oc-dialog-title { background: white; font-weight: bold; diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index d63680897793..24b88d8e1e24 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -10,12 +10,6 @@ _create: function() { var self = this; - this.originalCss = { - display: this.element[0].style.display, - width: this.element[0].style.width, - height: this.element[0].style.height - }; - this.originalTitle = this.element.attr('title'); this.options.title = this.options.title || this.originalTitle; @@ -29,11 +23,6 @@ this.$dialog.append(this.element.detach()); this.element.removeAttr('title').addClass('oc-dialog-content').appendTo(this.$dialog); - this.$dialog.css({ - display: 'inline-block', - position: 'fixed' - }); - $(document).on('keydown keyup', function(event) { if ( event.target !== self.$dialog.get(0) && @@ -138,12 +127,6 @@ this.$dialog.find('.oc-dialog-close').remove(); } break; - case 'width': - this.$dialog.css('width', value); - break; - case 'height': - this.$dialog.css('height', value); - break; case 'close': this.closeCB = value; break; @@ -155,27 +138,6 @@ //this._super(options); $.Widget.prototype._setOptions.apply(this, arguments); }, - _setSizes: function() { - // var content_height = this.$dialog.height(); - // if(this.$title) { - // content_height -= this.$title.outerHeight(true); - // } - // if(this.$buttonrow) { - // 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 (content_height> 0) { - // this.element.css({ - // height: content_height + 'px', - // width: this.$dialog.innerWidth()-20 + 'px' - // }); - // } else { - // this.element.css({ - // width : this.$dialog.innerWidth() - 20 + 'px' - // }); - // } - }, _createOverlay: function() { if(!this.options.modal) { return; diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js index 0677ceda76be..5ad032bbbcc5 100644 --- a/core/js/sharedialoglinkshareview.js +++ b/core/js/sharedialoglinkshareview.js @@ -23,13 +23,20 @@ '' + '' + '{{#if publicUploadPossible}}' + - '