Sha256: ab94af35a8e0338b7a635ea54314973dcb17bd43f130619c73db978f890072d3

Contents?: true

Size: 915 Bytes

Versions: 6

Compression:

Stored size: 915 Bytes

Contents

pageflow.ImageFile = Backbone.Model.extend({
  modelName: 'image_file',
  paramRoot: 'image_file',

  mixins: [pageflow.file, pageflow.stageProvider, pageflow.retryable],

  stageMapping: {
    uploading: {
      activeStates: ['uploading'],
      finishedStates: ['processing', 'processed', 'processing_failed'],
      failedStates: ['upload_failed']
    },
    processing: {
      activeStates: ['processing'],
      finishedStates: ['processed'],
      failedStates: ['processing_failed']
    }
  },

  urlRoot: function() {
    return this.isNew() ? this.collection.url() : '/editor/image_files';
  },

  isReady: function() {
    return this.get('state') === 'processed';
  },

  isPending: function() {
    return this.get('state') === 'processing';
  },

  isRetryable: function() {
    return this.get('state') === 'processing_failed';
  },

  isPositionable: function() {
    return this.isReady();
  }
});

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pageflow-0.1.0 app/assets/javascripts/pageflow/editor/models/image_file.js
pageflow-0.0.5 app/assets/javascripts/pageflow/editor/models/image_file.js
pageflow-0.0.4 app/assets/javascripts/pageflow/editor/models/image_file.js
pageflow-0.0.3 app/assets/javascripts/pageflow/editor/models/image_file.js
pageflow-0.0.2 app/assets/javascripts/pageflow/editor/models/image_file.js
pageflow-0.0.1 app/assets/javascripts/pageflow/editor/models/image_file.js