this._$ = $(nativeNode);
},
+ isRoot: function() {
+ return this.document.root.sameNode(this);
+ },
+
detach: function() {
var parent = this.parent();
this._$.detach();
};
},
+ /**
+ * Removes parent of a node if node has no siblings.
+ */
+ unwrap: function() {
+ if(this.isRoot()) {
+ return;
+ }
+ var parent = this.parent(),
+ grandParent;
+ if(parent.contents().length === 1) {
+ grandParent = parent.parent();
+ parent.unwrapContent();
+ return grandParent;
+ }
+ },
+
wrapText: function(params) {
return this.document._wrapText(_.extend({inside: this}, params));
},