From 418ebfbdf4c5b73fb29007c70dfde576ca799943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Tue, 17 Jan 2017 11:17:40 +0100 Subject: [PATCH 1/4] fit newFileMenu to css guidelines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/files/css/files.css | 36 ++++++------------------------------ apps/files/js/filelist.js | 2 +- apps/files/js/newfilemenu.js | 10 ++-------- 3 files changed, 9 insertions(+), 39 deletions(-) diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 7956ef5c6aeec..ada53abdc727e 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -768,36 +768,9 @@ html.ie8 #controls .button.new { } .newFileMenu { - width: 200px; - margin-left: -56px; - margin-top: 25px; - z-index: 1001; -} - -.newFileMenu .menuitem { - white-space: nowrap; - overflow: hidden; -} -.newFileMenu.popovermenu a.menuitem, -.newFileMenu.popovermenu label.menuitem, -.newFileMenu.popovermenu .menuitem { - padding: 0; - margin: 0; -} - -.newFileMenu.popovermenu a.menuitem.active { - opacity: 1; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; - filter: alpha(opacity=100); -} - -.newFileMenu.bubble:after { - left: 75px; - right: auto; -} -.newFileMenu.bubble:before { - left: 75px; - right: auto; + font-weight: 300; + top: 100%; + margin-top: 4px; } .newFileMenu .filenameform { @@ -835,6 +808,9 @@ html.ie8 #controls .button.new { height: 15px; } +.app-files .actions .button.new { + position: relative; +} .app-files .actions .button.new .icon { margin-bottom: 2px; } diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index bb50814dfdca7..f0e794cdc1ea1 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -2951,7 +2951,7 @@ this._newFileMenu = new OCA.Files.NewFileMenu({ fileList: this }); - $('body').append(this._newFileMenu.$el); + this._newButton.append(this._newFileMenu.$el); } this._newFileMenu.showAt($target); diff --git a/apps/files/js/newfilemenu.js b/apps/files/js/newfilemenu.js index 75c4cdcc0bac2..91cf63c9508c3 100644 --- a/apps/files/js/newfilemenu.js +++ b/apps/files/js/newfilemenu.js @@ -38,7 +38,8 @@ */ var NewFileMenu = OC.Backbone.View.extend({ tagName: 'div', - className: 'newFileMenu popovermenu bubble hidden open menu', + // Menu is opened by default because it's rendered on "add-button" click + className: 'newFileMenu popovermenu bubble menu open menu-center', events: { 'click .menuitem': '_onClickAction' @@ -235,13 +236,6 @@ */ showAt: function($target) { this.render(); - var targetOffset = $target.offset(); - this.$el.css({ - left: targetOffset.left, - top: targetOffset.top + $target.height() - }); - this.$el.removeClass('hidden'); - OC.showMenu(null, this.$el); } }); From 961fcfa1fb7d3c230a87cd4a92f69fada5d325b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Sat, 21 Jan 2017 20:05:58 +0100 Subject: [PATCH 2/4] Popover positionning and classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/files/css/files.css | 4 ++++ apps/files/js/filelist.js | 2 +- apps/files/js/newfilemenu.js | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/files/css/files.css b/apps/files/css/files.css index ada53abdc727e..31e613c71cf32 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -771,6 +771,10 @@ html.ie8 #controls .button.new { font-weight: 300; top: 100%; margin-top: 4px; + width: 120px; + margin-left: 7px; + margin-top: 38px; + z-index: 1001; } .newFileMenu .filenameform { diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index f0e794cdc1ea1..bcada9acfe589 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -2951,7 +2951,7 @@ this._newFileMenu = new OCA.Files.NewFileMenu({ fileList: this }); - this._newButton.append(this._newFileMenu.$el); + $('.actions').append(this._newFileMenu.$el); } this._newFileMenu.showAt($target); diff --git a/apps/files/js/newfilemenu.js b/apps/files/js/newfilemenu.js index 91cf63c9508c3..e4023c623426a 100644 --- a/apps/files/js/newfilemenu.js +++ b/apps/files/js/newfilemenu.js @@ -39,7 +39,7 @@ var NewFileMenu = OC.Backbone.View.extend({ tagName: 'div', // Menu is opened by default because it's rendered on "add-button" click - className: 'newFileMenu popovermenu bubble menu open menu-center', + className: 'newFileMenu popovermenu bubble menu open menu-left', events: { 'click .menuitem': '_onClickAction' From 3d86275f1efedcd174ef7226324754350556957b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Sat, 21 Jan 2017 20:07:15 +0100 Subject: [PATCH 3/4] Popover positionning fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/files/css/files.css | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 31e613c71cf32..3677db97b1ab6 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -773,7 +773,6 @@ html.ie8 #controls .button.new { margin-top: 4px; width: 120px; margin-left: 7px; - margin-top: 38px; z-index: 1001; } From 0fc0bcf6b3535f7e32f8fd4e5618a3707193acf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Sat, 21 Jan 2017 20:09:09 +0100 Subject: [PATCH 4/4] Popover newFolder input fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/files/css/files.css | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 3677db97b1ab6..05b8e58cbe45a 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -771,7 +771,7 @@ html.ie8 #controls .button.new { font-weight: 300; top: 100%; margin-top: 4px; - width: 120px; + min-width: 100px; margin-left: 7px; z-index: 1001; } @@ -781,9 +781,7 @@ html.ie8 #controls .button.new { } .newFileMenu .filenameform input { - width: 100%; - box-sizing: border-box; - margin: -2px 0; + margin: 2px 0; } #fileList .popovermenu .action {