Skip to content

Commit b00c9f1

Browse files
committed
Testing a presave hook in editor focusoutHandler
1 parent 0439c83 commit b00c9f1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/editor.coffee

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ textEditor = ($item, item, option={}) ->
9595
$item.removeClass 'textEditing'
9696
$textarea.unbind()
9797
$page = $item.parents('.page:first')
98-
if item[option.field||'text'] = $textarea.val()
98+
presave = option.presave or (item, value) ->
99+
return value
100+
if item[option.field||'text'] = presave item, $textarea.val()
99101
# Remove output and source styling as type may have changed.
100102
$item.removeClass("output-item")
101103
$item.removeClass (_index, className) ->

0 commit comments

Comments
 (0)