X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/3b0a39df2e007f33b027b665f0f42604aecfc8b9..9a93c89991001d4ed088bee3b20cea374aa91d37:/src/smartxml/smartxml.js diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index 53eefed..6e00a7d 100644 --- 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; + this.triggerTextChangeEvent(); }, appendText: function(text) { this.nativeNode.data = this.nativeNode.data + text; + this.triggerTextChangeEvent(); }, 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); } });