Sha256: de4129ce4527f5c805148b88b961412dc77788539c417a7dd6c47a9e80458b51

Contents?: true

Size: 583 Bytes

Versions: 6

Compression:

Stored size: 583 Bytes

Contents

class @GalleryImageModel extends Backbone.Model

  remove : () ->
    $.ajax
      type : 'delete'
      url : @get 'removeUrl'
      data :
        class_name : @collection.getClassName()
      dataType : 'json'
      success : () =>
        @trigger 'image-removed'
      error : (data) =>
        window.notifier.notify data.error

  crop : (url, cropData, cb) ->
    data =
      id : @get('imageId')
      class_name : @collection.getClassName()
    data.crop = cropData
    $.ajax
      type : 'post'
      url : url
      data : data
      dataType : 'json'
      success : cb

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rademade_admin-0.2.2 app/assets/javascripts/rademade_admin/app/gallery/image/model.coffee
rademade_admin-0.2.1 app/assets/javascripts/rademade_admin/app/gallery/image/model.coffee
rademade_admin-0.2.0 app/assets/javascripts/rademade_admin/app/gallery/image/model.coffee
rademade_admin-0.1.6 app/assets/javascripts/rademade_admin/app/gallery/image/model.coffee
rademade_admin-0.1.5 app/assets/javascripts/rademade_admin/app/gallery/image/model.coffee
rademade_admin-0.1.4 app/assets/javascripts/rademade_admin/app/gallery/image/model.coffee