2011-12-02 14:59:41 +00:00
|
|
|
Locomotive.Views.Sites ||= {}
|
2011-11-28 21:50:24 +00:00
|
|
|
|
2011-12-02 14:59:41 +00:00
|
|
|
class Locomotive.Views.Sites.DomainEntryView extends Backbone.View
|
2011-11-28 21:50:24 +00:00
|
|
|
|
|
|
|
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()
|
2011-11-29 01:24:02 +00:00
|
|
|
@$('input[type=text]').editableField('destroy')
|
2011-11-28 21:50:24 +00:00
|
|
|
@options.parent_view.remove_entry(@model)
|
|
|
|
super()
|