Sha256: 9e8867e8ad03f7c30833e8948bebc7ddc6d9141b6548945ea8f1bbb59b1cf913

Contents?: true

Size: 716 Bytes

Versions: 13

Compression:

Stored size: 716 Bytes

Contents

Locomotive.Views.Sites ||= {}

class Locomotive.Views.Sites.MembershipEntryView extends Backbone.View

  className: 'entry'

  events:
    'change select' :   'change'
    'click a.remove':   'remove'

  render: ->
    data        = @model.toJSON()
    data.index  = @options.index

    $(@el).html(ich.membership_entry(data))

    $(@el).attr('data-role', @model.get('role'))

    @$('select').val(@model.get('role'))

    return @

  change: (event) ->
    value = $(event.target).val()
    @options.parent_view.change_entry(@model, value)

  remove: (event) ->
    event.stopPropagation() & event.preventDefault()
    @$('select').editableField('destroy')
    @options.parent_view.remove_entry(@model)
    super()

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
tribeca_cms-0.1.1 app/assets/javascripts/locomotive/views/sites/membership_entry_view.js.coffee
tribeca_cms-2.0.0.rc12 app/assets/javascripts/locomotive/views/sites/membership_entry_view.js.coffee
locomotive_cms-2.0.0.rc12 app/assets/javascripts/locomotive/views/sites/membership_entry_view.js.coffee
locomotive_cms-2.0.0.rc11 app/assets/javascripts/locomotive/views/sites/membership_entry_view.js.coffee
locomotive_cms-2.0.0.rc10 app/assets/javascripts/locomotive/views/sites/membership_entry_view.js.coffee
locomotive_cms-2.0.0.rc9 app/assets/javascripts/locomotive/views/sites/membership_entry_view.js.coffee
locomotive_cms-2.0.0.rc8 app/assets/javascripts/locomotive/views/sites/membership_entry_view.js.coffee
locomotive_cms-2.0.0.rc7 app/assets/javascripts/locomotive/views/sites/membership_entry_view.js.coffee
locomotive_cms-2.0.0.rc6 app/assets/javascripts/locomotive/views/sites/membership_entry_view.js.coffee
locomotive_cms-2.0.0.rc5 app/assets/javascripts/locomotive/views/sites/membership_entry_view.js.coffee
locomotive_cms-2.0.0.rc4 app/assets/javascripts/locomotive/views/sites/membership_entry_view.js.coffee
locomotive_cms-2.0.0.rc2 app/assets/javascripts/locomotive/views/sites/membership_entry_view.js.coffee
locomotive_cms-2.0.0.rc1 app/assets/javascripts/locomotive/views/sites/membership_entry_view.js.coffee