Html Module can now be editing, saved, and re-opened

This commit is contained in:
Calen Pennington
2012-06-22 10:50:46 -04:00
parent f9bb8a701a
commit 72eef72d8b
10 changed files with 96 additions and 10 deletions

View File

@@ -1,8 +1,9 @@
class @HTML
constructor: (@id) ->
id = @id
$("##{id} .edit-box").on('input', ->
$("##{id} .preview").empty().append($(this).val())
@edit_box = $("##{@id} .edit-box")
@preview = $("##{@id} .preview")
@edit_box.on('input', =>
@preview.empty().append(@edit_box.val())
)
save: -> $("##{@id} .edit-box").val()
save: -> {text: @edit_box.val()}