diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-08-13 02:38:14 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-09-16 07:23:25 +0200 |
commit | 83d91ddf20bd2e61b9f01c82817ac8b815d3ac66 (patch) | |
tree | 8acdf4caedd9f867bf73f5d565cb176335e006cc /core/js/shareitemmodel.js | |
parent | b015eff2e92ba83c6bf95c0084e283ddc7a5df70 (diff) | |
download | nextcloud-server-83d91ddf20bd2e61b9f01c82817ac8b815d3ac66.tar.gz nextcloud-server-83d91ddf20bd2e61b9f01c82817ac8b815d3ac66.zip |
further work on reimplementing the dialog layout
Diffstat (limited to 'core/js/shareitemmodel.js')
-rw-r--r-- | core/js/shareitemmodel.js | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js index efce69f0f3e..eb93b91ce92 100644 --- a/core/js/shareitemmodel.js +++ b/core/js/shareitemmodel.js @@ -53,7 +53,10 @@ * // FIXME: use OC Share API once #17143 is done */ var ShareItemModel = OC.Backbone.Model.extend({ - initialize: function() { + initialize: function(attributes, options) { + if(!_.isUndefined(options.configModel)) { + this.configModel = options.configModel; + } this.fetch(); }, @@ -62,15 +65,24 @@ }, /** - * @returns {boolean|jQuery} + * @returns {boolean} */ - isPublicUploadEnabled: function() { - // FIXME: this really needs a better place - var publicUploadEnabled = $('#filestable').data('allow-public-upload'); - if (_.isUndefined(publicUploadEnabled)) { - publicUploadEnabled = 'no'; - } - return publicUploadEnabled; + isPublicUploadAllowed: function() { + return this.get('allowPublicUploadStatus'); + }, + + /** + * @returns {boolean} + */ + isFolder: function() { + return this.get('itemType') === 'folder'; + }, + + /** + * @returns {boolean} + */ + isFile: function() { + return this.get('itemType') === 'file'; }, /** @@ -134,7 +146,14 @@ * @returns {boolean} */ hasSharePermission: function() { - return (this.getPermissions & OC.PERMISSION_SHARE) === OC.PERMISSION_SHARE; + return (this.getPermissions() & OC.PERMISSION_SHARE) === OC.PERMISSION_SHARE; + }, + + /** + * @returns {boolean} + */ + hasCreatePermission: function() { + return (this.getPermissions() & OC.PERMISSION_CREATE) === OC.PERMISSION_CREATE; }, fetch: function() { |