fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
smartxml: changing TextNode text emits nodeTextChange event
[fnpeditor.git]
/
src
/
smartxml
/
smartxml.js
diff --git
a/src/smartxml/smartxml.js
b/src/smartxml/smartxml.js
index
53eefed
..
6e00a7d
100644
(file)
--- a/
src/smartxml/smartxml.js
+++ b/
src/smartxml/smartxml.js
@@
-211,14
+211,22
@@
$.extend(TextNode.prototype, DocumentNode.prototype, {
setText: function(text) {
this.nativeNode.data = text;
setText: function(text) {
this.nativeNode.data = text;
+ this.triggerTextChangeEvent();
},
appendText: function(text) {
this.nativeNode.data = this.nativeNode.data + text;
},
appendText: function(text) {
this.nativeNode.data = this.nativeNode.data + text;
+ this.triggerTextChangeEvent();
},
prependText: function(text) {
this.nativeNode.data = text + this.nativeNode.data;
},
prependText: function(text) {
this.nativeNode.data = text + this.nativeNode.data;
+ this.triggerTextChangeEvent();
+ },
+
+ triggerTextChangeEvent: function() {
+ var event = new events.ChangeEvent('nodeTextChange', {node: this});
+ this.document.trigger('change', event);
}
});
}
});