Skip to content

Commit

Permalink
Merge pull request nextcloud#15767 from nextcloud/bugfix/0b-quota-create
Browse files Browse the repository at this point in the history
Hide newFile menu if quota is set to 0B
  • Loading branch information
MorrisJobke authored May 28, 2019
2 parents 4ff4d55 + 1cf16fa commit 64fb083
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 3 additions & 6 deletions apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -2036,7 +2036,7 @@
this.breadcrumb.setDirectoryInfo(this.dirInfo);

if (this.dirInfo.permissions) {
this.setDirectoryPermissions(this.dirInfo.permissions);
this._updateDirectoryPermissions();
}

result.sort(this._sortComparator);
Expand Down Expand Up @@ -2187,11 +2187,8 @@
img.src = previewURL;
},

/**
* @deprecated
*/
setDirectoryPermissions: function(permissions) {
var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0;
_updateDirectoryPermissions: function() {
var isCreatable = (this.dirInfo.permissions & OC.PERMISSION_CREATE) !== 0 && this.$el.find('#free_space').val() !== '0';
this.$el.find('#permissions').val(permissions);
this.$el.find('.creatable').toggleClass('hidden', !isCreatable);
this.$el.find('.notCreatable').toggleClass('hidden', isCreatable);
Expand Down
1 change: 1 addition & 0 deletions apps/files/js/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
$('#owner').val(response.data.owner);
$('#ownerDisplayName').val(response.data.ownerDisplayName);
Files.displayStorageWarnings();
OCA.Files.App.fileList._updateDirectoryPermissions();
}
if (response[0] === undefined) {
return;
Expand Down

0 comments on commit 64fb083

Please sign in to comment.