Sha256: 7d7184a690fc8031984e2455e6f13af9daab63c552ec1ea83770ce1fe3f90d33

Contents?: true

Size: 650 Bytes

Versions: 13

Compression:

Stored size: 650 Bytes

Contents

class Locomotive.Models.ContentAsset extends Backbone.Model

  paramRoot: 'content_asset'

  urlRoot: "#{Locomotive.mounted_on}/content_assets"

  initialize: ->
    @prepare()

  prepare: ->
    @set(filename: @get('source').name.truncate(15)) if @get('uploading')

    @set
      image:          @get('content_type') == 'image'
      with_thumbnail: @get('content_type') == 'image' || @get('content_type') == 'pdf'

    return @

  toJSONForSave: ->
    { source: @get('source') }

class Locomotive.Models.ContentAssetsCollection extends Backbone.Collection

  model: Locomotive.Models.ContentAsset

  url: "#{Locomotive.mounted_on}/content_assets"

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
locomotive_cms-2.5.7 app/assets/javascripts/locomotive/models/content_asset.js.coffee
locomotive_cms-2.5.6 app/assets/javascripts/locomotive/models/content_asset.js.coffee
locomotive_cms-2.5.6.rc2 app/assets/javascripts/locomotive/models/content_asset.js.coffee
locomotive_cms-2.5.6.rc1 app/assets/javascripts/locomotive/models/content_asset.js.coffee
locomotive_cms-2.5.5 app/assets/javascripts/locomotive/models/content_asset.js.coffee
locomotive_cms-2.5.4 app/assets/javascripts/locomotive/models/content_asset.js.coffee
locomotive_cms-2.5.3 app/assets/javascripts/locomotive/models/content_asset.js.coffee
locomotive_cms-2.5.2 app/assets/javascripts/locomotive/models/content_asset.js.coffee
locomotive_cms-2.5.1 app/assets/javascripts/locomotive/models/content_asset.js.coffee
locomotive_cms-2.5.0 app/assets/javascripts/locomotive/models/content_asset.js.coffee
locomotive_cms-2.5.0.rc3 app/assets/javascripts/locomotive/models/content_asset.js.coffee
locomotive_cms-2.5.0.rc2 app/assets/javascripts/locomotive/models/content_asset.js.coffee
locomotive_cms-2.5.0.rc1 app/assets/javascripts/locomotive/models/content_asset.js.coffee