You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2017/12/22 07:00:19 UTC

[royale-asjs] 02/04: allow either child tags or html content

This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch feature/royalesite
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit a858f8d2790c811d35de726e8b46cd371fe997c4
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Dec 21 22:45:07 2017 -0800

    allow either child tags or html content
---
 .../apache/royale/html/TextNodeContainerBase.as    | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/TextNodeContainerBase.as b/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/TextNodeContainerBase.as
index 64723a1..d0fca4a 100644
--- a/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/TextNodeContainerBase.as
+++ b/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/TextNodeContainerBase.as
@@ -20,6 +20,8 @@ package org.apache.royale.html
 {
     import org.apache.royale.core.UIBase;
 
+    [DefaultProperty("mxmlContent|textContent")]
+    
     public class TextNodeContainerBase extends NodeElementBase
     {
         public function TextNodeContainerBase()
@@ -57,6 +59,31 @@ package org.apache.royale.html
 			}
 		}
 		
+        private var _textContent:String = "";
+        
+        /**
+         *  The innerHTML of the element
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
+        public function get textContent():String
+        {
+            // textContent is special cased in the compiler
+            return _textContent;
+        }
+        public function set textContent(value:String):void
+        {
+            _textContent = value;
+            
+            COMPILE::JS
+            {
+                element.innerHTML = value;
+            }
+        }
+        
         COMPILE::JS
         protected var textNode:Text;
 

-- 
To stop receiving notification emails like this one, please contact
"commits@royale.apache.org" <co...@royale.apache.org>.