ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject [07/12] incubator-ponymail git commit: add html prototype for emptying an element
Date Sat, 03 Sep 2016 07:45:55 GMT
add html prototype for emptying an element

we clone the element as a bare element (no kids!)
and then replace the old with the new element.


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

Branch: refs/heads/coffee-and-cake
Commit: b7fe4def4cbefd68379c0fc87e7f63169d883a66
Parents: 7e48948
Author: Daniel Gruno <humbedooh@apache.org>
Authored: Sat Sep 3 09:41:04 2016 +0200
Committer: Daniel Gruno <humbedooh@apache.org>
Committed: Sat Sep 3 09:41:04 2016 +0200

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


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/b7fe4def/site/js/coffee/dom_utils.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/dom_utils.coffee b/site/js/coffee/dom_utils.coffee
index 563285c..b77e326 100644
--- a/site/js/coffee/dom_utils.coffee
+++ b/site/js/coffee/dom_utils.coffee
@@ -124,6 +124,14 @@ HTMLElement.prototype.show = (bool) ->
     this.style.display = d
     return d
 
+###*
+# prototype for emptying an html element
+###
+HTMLElement.prototype.empty = () ->
+    ndiv = this.cloneNode()
+    this.parentNode.replaceChild(ndiv, this)
+    return ndiv
+
 ### Cog: Loading panel for when waiting for a response ###
 cog = (div, size = 200) ->
         idiv = mk('div', {


Mime
View raw message