Polymer elements support bind, creation of new elements, overwrite with simple object, events

This commit is contained in:
DadaMonad
2014-12-26 13:36:45 +00:00
parent fd1128d456
commit 6790355232
84 changed files with 249 additions and 31221 deletions

View File

@@ -52,7 +52,7 @@ module.exports = (HB)->
for name,o of @map
if not o.isContentDeleted()
obj = o.val()
if obj instanceof types.ImmutableObject or obj instanceof MapManager
if obj instanceof types.ImmutableObject # or obj instanceof MapManager TODO: do you want deep json?
obj = obj.val()
result[name] = obj
result

View File

@@ -206,34 +206,34 @@ module.exports = (HB)->
word = @
textfield.value = @val()
@on "insert", (event, op)->
o_pos = op.getPosition()
fix = (cursor)->
if cursor <= o_pos
cursor
else
cursor += 1
cursor
left = fix textfield.selectionStart
right = fix textfield.selectionEnd
@observe (events)->
for event in events
if event.type is "insert"
o_pos = event.position
fix = (cursor)->
if cursor <= o_pos
cursor
else
cursor += 1
cursor
left = fix textfield.selectionStart
right = fix textfield.selectionEnd
textfield.value = word.val()
textfield.setSelectionRange left, right
textfield.value = word.val()
textfield.setSelectionRange left, right
else if event.type is "delete"
o_pos = event.position
fix = (cursor)->
if cursor < o_pos
cursor
else
cursor -= 1
cursor
left = fix textfield.selectionStart
right = fix textfield.selectionEnd
@on "delete", (event, op)->
o_pos = op.getPosition()
fix = (cursor)->
if cursor < o_pos
cursor
else
cursor -= 1
cursor
left = fix textfield.selectionStart
right = fix textfield.selectionEnd
textfield.value = word.val()
textfield.setSelectionRange left, right
textfield.value = word.val()
textfield.setSelectionRange left, right
# consume all text-insert changes.
textfield.onkeypress = (event)->