You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2016/09/02 11:19:43 UTC

[6/7] incubator-ponymail git commit: convert to textNode if string

convert to textNode if string

might as well have this here as well, speeds up things.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/bdbf65e7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/bdbf65e7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/bdbf65e7

Branch: refs/heads/coffee-and-cake
Commit: bdbf65e783f6ce19b9353d978d457f19e32c7dba
Parents: 874179e
Author: Daniel Gruno <hu...@apache.org>
Authored: Fri Sep 2 13:18:48 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Fri Sep 2 13:18:48 2016 +0200

----------------------------------------------------------------------
 site/js/coffee/dom_utils.coffee | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/bdbf65e7/site/js/coffee/dom_utils.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/dom_utils.coffee b/site/js/coffee/dom_utils.coffee
index fe10125..9ca7fed 100644
--- a/site/js/coffee/dom_utils.coffee
+++ b/site/js/coffee/dom_utils.coffee
@@ -108,8 +108,14 @@ get = (a) ->
 HTMLElement.prototype.inject = (child) ->
     if isArray(child)
         for item in child
+            # Convert to textNode if string
+            if typeof item is 'string'
+                item = txt(item)
             this.appendChild(item)
     else
+        # Convert to textNode if string
+        if typeof child is 'string'
+            child = txt(child)
         this.appendChild(child)
     return child