Re: flex-asjs git commit: Change innerHTML for a textNode to avoid remove text when using beads that “append” html tags
Hi Piotr, this change is to handle the case where a tag node has mxml inner elements or has simple text. So normaly what you say is true, but here we are handling if user wants text (so creating a text node) or if he wants other nested tags (something I was struggling to get for the last month and finaly this is the way to do it) 2016-12-10 17:49 GMT+01:00 Piotr Zarzycki: > Hi Carlos, > > Is it creation of internal elements shouldn't be in createElement instead > in some setter? > > Piotr > > On Sat, Dec 10, 2016, 17:36 wrote: > > > Repository: flex-asjs > > Updated Branches: > > refs/heads/develop 07dfd97bb -> 9b467ea51 > > > > > > Change innerHTML for a textNode to avoid remove text when using beads > that > > “append” html tags > > > > > > Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo > > Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/9b467ea5 > > Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/9b467ea5 > > Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/9b467ea5 > > > > Branch: refs/heads/develop > > Commit: 9b467ea5129b93d12e785b7a73de7a60303a01c2 > > Parents: 07dfd97 > > Author: Carlos Rovira > > Authored: Sat Dec 10 17:36:13 2016 +0100 > > Committer: Carlos Rovira > > Committed: Sat Dec 10 17:36:13 2016 +0100 > > > > -- > > .../HTML/src/main/flex/org/apache/flex/html/Span.as | 14 > -- > > 1 file changed, 12 insertions(+), 2 deletions(-) > > -- > > > > > > > > http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ > 9b467ea5/frameworks/projects/HTML/src/main/flex/org/apache/ > flex/html/Span.as > > -- > > diff --git > > a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as > > b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as > > index 1771948..7dbe220 100644 > > --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/ > html/Span.as > > +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/ > html/Span.as > > @@ -70,13 +70,23 @@ package org.apache.flex.html > > > > COMPILE::JS > > { > > - if(MXMLDescriptor == null) { > > - element.innerHTML = text; > > + if(MXMLDescriptor == null) > > +{ > > +if(textNode == null) > > +{ > > +textNode = document.createTextNode('') as Text; > > +element.appendChild(textNode); > > +} > > + > > +textNode.nodeValue = value; > > } > > } > > > > } > > > > +COMPILE::JS > > +private var textNode:Text; > > + > > /** > > * @flexjsignorecoercion org.apache.flex.core. > WrappedHTMLElement > > */ > > > > > -- Carlos Rovira Director General M: +34 607 22 60 05 http://www.codeoscopic.com http://www.avant2.es Este mensaje se dirige exclusivamente a su destinatario y puede contener información privilegiada o confidencial. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente por esta misma vía y proceda a su destrucción. De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC S.A. La finalidad de dicho tratamiento es facilitar la prestación del servicio o información solicitados, teniendo usted derecho de acceso, rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación necesaria.
Re: flex-asjs git commit: Change innerHTML for a textNode to avoid remove text when using beads that “append” html tags
Hi Carlos, Is it creation of internal elements shouldn't be in createElement instead in some setter? Piotr On Sat, Dec 10, 2016, 17:36wrote: > Repository: flex-asjs > Updated Branches: > refs/heads/develop 07dfd97bb -> 9b467ea51 > > > Change innerHTML for a textNode to avoid remove text when using beads that > “append” html tags > > > Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo > Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/9b467ea5 > Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/9b467ea5 > Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/9b467ea5 > > Branch: refs/heads/develop > Commit: 9b467ea5129b93d12e785b7a73de7a60303a01c2 > Parents: 07dfd97 > Author: Carlos Rovira > Authored: Sat Dec 10 17:36:13 2016 +0100 > Committer: Carlos Rovira > Committed: Sat Dec 10 17:36:13 2016 +0100 > > -- > .../HTML/src/main/flex/org/apache/flex/html/Span.as | 14 -- > 1 file changed, 12 insertions(+), 2 deletions(-) > -- > > > > http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9b467ea5/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as > -- > diff --git > a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as > b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as > index 1771948..7dbe220 100644 > --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as > +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as > @@ -70,13 +70,23 @@ package org.apache.flex.html > > COMPILE::JS > { > - if(MXMLDescriptor == null) { > - element.innerHTML = text; > + if(MXMLDescriptor == null) > +{ > +if(textNode == null) > +{ > +textNode = document.createTextNode('') as Text; > +element.appendChild(textNode); > +} > + > +textNode.nodeValue = value; > } > } > > } > > +COMPILE::JS > +private var textNode:Text; > + > /** > * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement > */ > >
flex-asjs git commit: Change innerHTML for a textNode to avoid remove text when using beads that “append” html tags
Repository: flex-asjs Updated Branches: refs/heads/develop 07dfd97bb -> 9b467ea51 Change innerHTML for a textNode to avoid remove text when using beads that âappendâ html tags Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/9b467ea5 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/9b467ea5 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/9b467ea5 Branch: refs/heads/develop Commit: 9b467ea5129b93d12e785b7a73de7a60303a01c2 Parents: 07dfd97 Author: Carlos RoviraAuthored: Sat Dec 10 17:36:13 2016 +0100 Committer: Carlos Rovira Committed: Sat Dec 10 17:36:13 2016 +0100 -- .../HTML/src/main/flex/org/apache/flex/html/Span.as | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9b467ea5/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as -- diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as index 1771948..7dbe220 100644 --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as @@ -70,13 +70,23 @@ package org.apache.flex.html COMPILE::JS { - if(MXMLDescriptor == null) { - element.innerHTML = text; + if(MXMLDescriptor == null) +{ +if(textNode == null) +{ +textNode = document.createTextNode('') as Text; +element.appendChild(textNode); +} + +textNode.nodeValue = value; } } } +COMPILE::JS +private var textNode:Text; + /** * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement */