fixing bind in shadow root

This commit is contained in:
DadaMonad 2015-01-19 04:41:40 +00:00
parent 9f9ba33428
commit 08fe014f9b
7 changed files with 43 additions and 35 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -283,7 +283,8 @@ module.exports = (HB)->
# var textbox = document.getElementById("textfield"); # var textbox = document.getElementById("textfield");
# yatta.bind(textbox); # yatta.bind(textbox);
# #
bind: (textfield)-> bind: (textfield, dom_root)->
dom_root ?= window;
# don't duplicate! # don't duplicate!
for t in @textfields for t in @textfields
if t is textfield if t is textfield
@ -311,10 +312,9 @@ module.exports = (HB)->
textfield.value = content textfield.value = content
else else
createRange = (fix)-> createRange = (fix)->
textnode = textfield.childNodes[0] s = dom_root.getSelection()
s = window.getSelection().getRangeAt(0) left = s.baseOffset
left = s.startOffset right = s.extentOffset
right = s.endOffset
if fix? if fix?
left = fix left left = fix left
right = fix right right = fix right

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long