really fixed the shadow dom bug :)
This commit is contained in:
parent
08fe014f9b
commit
fb68550e2c
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
@ -4,6 +4,7 @@
|
||||
|
||||
<polymer-element name="yatta-test" attributes="yatta connector stuff">
|
||||
<template>
|
||||
<h1 id="text" contentEditable> Check this out !</h1>
|
||||
<xmpp-connector id="connector" connector={{connector}} room="testy-xmpp-polymer"></xmpp-connector>
|
||||
<yatta-element connector={{connector}} val={{yatta}}>
|
||||
<yatta-property name="slider" val={{slider}}>
|
||||
@ -23,8 +24,14 @@
|
||||
Polymer({
|
||||
ready: function(){
|
||||
window.y_stuff_property = this.$.otherstuff;
|
||||
|
||||
this.yatta.val("slider",50)
|
||||
var that = this;
|
||||
this.connector.whenSynced(function(){
|
||||
if(that.yatta.val("text") == null){
|
||||
that.yatta.val("text","stuff","mutable");
|
||||
}
|
||||
that.yatta.val("text").bind(that.$.text,that.shadowRoot)
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
@ -23,17 +23,6 @@ module.exports = (HB)->
|
||||
|
||||
type: "TextInsert"
|
||||
|
||||
#
|
||||
# Inserts a string into the word.
|
||||
#
|
||||
# @return {Array Type} This String object.
|
||||
#
|
||||
insert: (position, content, options)->
|
||||
ith = @getOperationByPosition position
|
||||
# the (i-1)th character. e.g. "abc" the 1th character is "a"
|
||||
# the 0th character is the left Delimiter
|
||||
@insertAfter ith, content, options
|
||||
|
||||
#
|
||||
# Retrieve the effective length of the $content of this operation.
|
||||
#
|
||||
@ -272,9 +261,16 @@ module.exports = (HB)->
|
||||
toString: ()->
|
||||
@val()
|
||||
|
||||
# String must not set options! (the third parameter)
|
||||
insert: (position, content)->
|
||||
super position, content
|
||||
#
|
||||
# Inserts a string into the word.
|
||||
#
|
||||
# @return {Array Type} This String object.
|
||||
#
|
||||
insert: (position, content, options)->
|
||||
ith = @getOperationByPosition position
|
||||
# the (i-1)th character. e.g. "abc" the 1th character is "a"
|
||||
# the 0th character is the left Delimiter
|
||||
@insertAfter ith, content, options
|
||||
|
||||
#
|
||||
# Bind this String to a textfield or input field.
|
||||
@ -313,8 +309,9 @@ module.exports = (HB)->
|
||||
else
|
||||
createRange = (fix)->
|
||||
s = dom_root.getSelection()
|
||||
left = s.baseOffset
|
||||
right = s.extentOffset
|
||||
clength = textfield.textContent.length
|
||||
left = Math.min s.baseOffset, clength
|
||||
right = Math.min s.extentOffset, clength
|
||||
if fix?
|
||||
left = fix left
|
||||
right = fix right
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user