diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-09-22 16:47:52 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-09-22 16:47:52 +0200 |
commit | a7d84287ad150bc9b3008074829bb947f5cdd611 (patch) | |
tree | a021edb4c3ad60462eb50cc2dc56061b65b89257 /apps | |
parent | 498e8f712c3512a7e8b054194f82611fae931353 (diff) | |
download | nextcloud-server-a7d84287ad150bc9b3008074829bb947f5cdd611.tar.gz nextcloud-server-a7d84287ad150bc9b3008074829bb947f5cdd611.zip |
Only render the plus button when it makes sense
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/js/filelist.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index ece330d41cc..3b7d39adf0f 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)); |