Sha256: 8e73c8d9351bfad38bf8a612866ea80c4edb65b0755bf9e788ac6c02e2f6e396
Contents?: true
Size: 1.41 KB
Versions: 8
Compression:
Stored size: 1.41 KB
Contents
pageflow.UploadedFile = Backbone.Model.extend({ mixins: [pageflow.stageProvider, pageflow.retryable], urlRoot: function() { return this.isNew() ? this.collection.url() : '/editor/files/' + this.fileType().collectionName; }, fileType: function() { return this.collection && this.collection.fileType; }, isUploading: function() { return this.get('state') === 'uploading'; }, isUploaded: function() { return this.get('state') !== 'uploading' && this.get('state') !== 'upload_failed'; }, isPending: function() { return !this.isReady() && !this.isFailed(); }, isReady: function() { return this.get('state') === this.readyState; }, isFailed: function() { return this.get('state') && !!this.get('state').match(/_failed$/); }, isRetryable: function() { return !!this.get('retryable'); }, isConfirmable: function() { return false; }, isPositionable: function() { return false; }, cancelUpload: function() { if (this.get('state') === 'uploading') { this.trigger('uploadCancelled'); this.destroy(); } }, uploadFailed: function() { this.set('state', 'upload_failed'); this.unset('uploading_progress'); this.trigger('uploadFailed'); }, destroyUsage: function() { var usage = new pageflow.FileUsage({id: this.get('usage_id')}); usage.destroy(); this.trigger('destroy', this, this.collection, {}); } });
Version data entries
8 entries across 8 versions & 1 rubygems