25 lines
556 B
CoffeeScript
25 lines
556 B
CoffeeScript
|
Locomotive.Views.CurrentSite ||= {}
|
||
|
|
||
|
class Locomotive.Views.Site.DomainEntryView extends Backbone.View
|
||
|
|
||
|
tagName: 'li'
|
||
|
|
||
|
className: 'domain'
|
||
|
|
||
|
events:
|
||
|
'change input[type=text]' : 'change'
|
||
|
'click a.remove': 'remove'
|
||
|
|
||
|
render: ->
|
||
|
$(@el).html(ich.domain_entry(@model.toJSON()))
|
||
|
|
||
|
return @
|
||
|
|
||
|
change: (event) ->
|
||
|
value = $(event.target).val()
|
||
|
@options.parent_view.change_entry(@model, value)
|
||
|
|
||
|
remove: (event) ->
|
||
|
event.stopPropagation() & event.preventDefault()
|
||
|
@options.parent_view.remove_entry(@model)
|
||
|
super()
|