diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2017-11-10 08:23:24 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2017-11-10 08:23:24 +0100 |
commit | f40e56f0e645cfb36ed39decdba7d4a215ed986c (patch) | |
tree | b743da4edb2b48745260a0dc8c798e61979c2206 /apps/files/js/breadcrumb.js | |
parent | ebf131be84cfbab2ce024e7beabcd2820bd7b4bd (diff) | |
download | nextcloud-server-f40e56f0e645cfb36ed39decdba7d4a215ed986c.tar.gz nextcloud-server-f40e56f0e645cfb36ed39decdba7d4a215ed986c.zip |
Fix menu declaration and width calculation
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/js/breadcrumb.js')
-rw-r--r-- | apps/files/js/breadcrumb.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/files/js/breadcrumb.js b/apps/files/js/breadcrumb.js index 44dccf95b7c..35aeb8d357d 100644 --- a/apps/files/js/breadcrumb.js +++ b/apps/files/js/breadcrumb.js @@ -114,8 +114,8 @@ * Renders the breadcrumb elements */ render: function() { - // Hide menu on render - OC.hideMenus(); + // Menu is destroyed on every change, we need to init it + OC.unregisterMenu($('.crumbmenu'), $('.crumbmenu > .popovermenu')); var parts = this._makeCrumbs(this.dir || '/'); var $crumb; @@ -193,8 +193,10 @@ greedy: true }); } + // Menu is destroyed on every change, we need to init it OC.registerMenu($('.crumbmenu'), $('.crumbmenu > .popovermenu')); + this._resize(); }, @@ -329,7 +331,7 @@ // Used for testing since this.$el.parent fails if (!this.availableWidth) { - this.usedWidth = this.$el.parent().width() - this.$el.next('.actions').width(); + this.usedWidth = this.$el.parent().width() - (this.$el.parent().find('.button').length + 1) * 44; } else { this.usedWidth = this.availableWidth; } @@ -337,7 +339,7 @@ // If container is smaller than content // AND if there are crumbs left to hide while (this.getTotalWidth() > this.usedWidth - && this.$el.find(this.crumbSelector).length > 0) { + && this.$el.find(this.crumbSelector).length > 0) { this._hideCrumb(); } // If container is bigger than content + element to be shown |