[loki-editor commit] r669 - trunk/src

0 views
Skip to first unread message

codesite...@google.com

unread,
Dec 4, 2008, 5:40:29 PM12/4/08
to loki-c...@googlegroups.com
Author: enaeseth
Date: Thu Dec 4 14:29:49 2008
New Revision: 669

Modified:
trunk/src/utilities.js

Log:
Adding a new helper method: Element#replaceWithChildren.

Modified: trunk/src/utilities.js
==============================================================================
--- trunk/src/utilities.js (original)
+++ trunk/src/utilities.js Thu Dec 4 14:29:49 2008
@@ -305,6 +305,20 @@
}

return attrs;
+ },
+
+ replaceWithChildren: function replace_element_with_children() {
+ var parent = this.parentNode;
+
+ if (!parent)
+ return false;
+
+ while (this.firstChild) {
+ parent.insertBefore(this.firstChild, this);
+ }
+
+ parent.removeChild(this);
+ return true;
}
};

Reply all
Reply to author
Forward
0 new messages