Sha256: ada3a3d17d1ffdd3216d76664a101e39f00836d98d1e2cfbc5e0d30f6000f5c0
Contents?: true
Size: 1.52 KB
Versions: 9
Compression:
Stored size: 1.52 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; }, title: function() { return this.get('file_name'); }, thumbnailFile: function() { return this; }, 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
9 entries across 9 versions & 1 rubygems