fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
smartxml: wrapping TextNode content
[fnpeditor.git]
/
src
/
smartxml
/
smartxml.js
diff --git
a/src/smartxml/smartxml.js
b/src/smartxml/smartxml.js
index
7c68e06
..
2e507db
100644
(file)
--- a/
src/smartxml/smartxml.js
+++ b/
src/smartxml/smartxml.js
@@
-41,10
+41,13
@@
$.extend(DocumentNode.prototype, {
},
wrapWith: function(node) {
},
wrapWith: function(node) {
+ node = node instanceof ElementNode ? node : this.document.createElementNode(node);
+
if(this.parent()) {
this.before(node);
}
node.append(this);
if(this.parent()) {
this.before(node);
}
node.append(this);
+ return node;
},
triggerChangeEvent: function(type, metaData) {
},
triggerChangeEvent: function(type, metaData) {
@@
-245,7
+248,7
@@
$.extend(Document.prototype, Backbone.Events, {
createElementNode: function(from) {
if(!(from instanceof HTMLElement)) {
createElementNode: function(from) {
if(!(from instanceof HTMLElement)) {
- from = $('<' + from.tagName + '>');
+ from = $('<' + from.tagName + '>')
[0]
;
}
return new this.ElementNodeFactory(from, this);
},
}
return new this.ElementNodeFactory(from, this);
},