Sha256: 7269ff5052b41c9dee0c2b79cd1dd1093b79e86545f7a0d4e749f3d3cfc51ffd

Contents?: true

Size: 1003 Bytes

Versions: 4

Compression:

Stored size: 1003 Bytes

Contents

pageflow.ImageFile = Backbone.Model.extend({
  modelName: 'image_file',
  paramRoot: 'image_file',
  i18nKey: 'pageflow/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';
  },

  isConfirmable: function() {
    return false;
  },

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pageflow-0.4.0 app/assets/javascripts/pageflow/editor/models/image_file.js
pageflow-0.3.0 app/assets/javascripts/pageflow/editor/models/image_file.js
pageflow-0.2.1 app/assets/javascripts/pageflow/editor/models/image_file.js
pageflow-0.2.0 app/assets/javascripts/pageflow/editor/models/image_file.js