From a7d84287ad150bc9b3008074829bb947f5cdd611 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 22 Sep 2015 16:47:52 +0200 Subject: [PATCH] Only render the plus button when it makes sense --- apps/files/js/filelist.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index ece330d41c..3b7d39adf0 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -2537,8 +2537,9 @@ }, _renderNewButton: function() { - // if an upload button (legacy) already exists, skip - if ($('#controls .button.upload').length) { + // if an upload button (legacy) already exists or no actions container exist, skip + var $actionsContainer = this.$el.find('#controls .actions'); + if (!$actionsContainer.length || this.$el.find('.button.upload').length) { return; } if (!this._addButtonTemplate) { @@ -2549,7 +2550,7 @@ iconUrl: OC.imagePath('core', 'actions/add') })); - $('#controls .actions').prepend($newButton); + $actionsContainer.prepend($newButton); $newButton.tooltip({'placement': 'bottom'}); $newButton.click(_.bind(this._onClickNewButton, this));