Merge pull request #19277 from owncloud/files-plusbuttonfix

Only render the plus button when it makes sense
This commit is contained in:
Thomas Müller 2015-09-23 11:31:52 +02:00
commit 4c62d71db7
1 changed files with 4 additions and 3 deletions

View File

@ -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));