smartxml: ElementNode.prepend
[fnpeditor.git] / src / smartxml / smartxml.js
index 56e78af..91dd8bb 100644 (file)
@@ -154,6 +154,11 @@ $.extend(ElementNode.prototype, {
         this._$.append(node.nativeNode);
     },
 
+    prepend: function(node) {
+        node = node instanceof DocumentNode ? node : this.document.createElementNode(node);
+        this._$.prepend(node.nativeNode);
+    },
+
     unwrapContent: function() {
         var parent = this.parent();
         if(!parent) {