From: Julius Härtl Date: Tue, 28 May 2019 08:27:01 +0000 (+0200) Subject: Hide newFile menu if quota is set to 0B X-Git-Tag: v16.0.2RC1~45^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f8d32096b2f66837915ad02fc7ad8fe8e993e43b;p=nextcloud-server.git Hide newFile menu if quota is set to 0B Signed-off-by: Julius Härtl --- diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 306417230f1..3f4c14f95d0 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -2038,7 +2038,7 @@ this.breadcrumb.setDirectoryInfo(this.dirInfo); if (this.dirInfo.permissions) { - this.setDirectoryPermissions(this.dirInfo.permissions); + this._updateDirectoryPermissions(); } result.sort(this._sortComparator); @@ -2189,11 +2189,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); diff --git a/apps/files/js/files.js b/apps/files/js/files.js index d044d365ed6..d2fcdf7839a 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -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;