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">
|
<polymer-element name="yatta-test" attributes="yatta connector stuff">
|
||||||
<template>
|
<template>
|
||||||
|
<h1 id="text" contentEditable> Check this out !</h1>
|
||||||
<xmpp-connector id="connector" connector={{connector}} room="testy-xmpp-polymer"></xmpp-connector>
|
<xmpp-connector id="connector" connector={{connector}} room="testy-xmpp-polymer"></xmpp-connector>
|
||||||
<yatta-element connector={{connector}} val={{yatta}}>
|
<yatta-element connector={{connector}} val={{yatta}}>
|
||||||
<yatta-property name="slider" val={{slider}}>
|
<yatta-property name="slider" val={{slider}}>
|
||||||
@ -23,8 +24,14 @@
|
|||||||
Polymer({
|
Polymer({
|
||||||
ready: function(){
|
ready: function(){
|
||||||
window.y_stuff_property = this.$.otherstuff;
|
window.y_stuff_property = this.$.otherstuff;
|
||||||
|
|
||||||
this.yatta.val("slider",50)
|
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>
|
</script>
|
||||||
|
@ -23,17 +23,6 @@ module.exports = (HB)->
|
|||||||
|
|
||||||
type: "TextInsert"
|
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.
|
# Retrieve the effective length of the $content of this operation.
|
||||||
#
|
#
|
||||||
@ -272,9 +261,16 @@ module.exports = (HB)->
|
|||||||
toString: ()->
|
toString: ()->
|
||||||
@val()
|
@val()
|
||||||
|
|
||||||
# String must not set options! (the third parameter)
|
#
|
||||||
insert: (position, content)->
|
# Inserts a string into the word.
|
||||||
super position, content
|
#
|
||||||
|
# @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.
|
# Bind this String to a textfield or input field.
|
||||||
@ -313,8 +309,9 @@ module.exports = (HB)->
|
|||||||
else
|
else
|
||||||
createRange = (fix)->
|
createRange = (fix)->
|
||||||
s = dom_root.getSelection()
|
s = dom_root.getSelection()
|
||||||
left = s.baseOffset
|
clength = textfield.textContent.length
|
||||||
right = s.extentOffset
|
left = Math.min s.baseOffset, clength
|
||||||
|
right = Math.min s.extentOffset, clength
|
||||||
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
Loading…
x
Reference in New Issue
Block a user