From: Aleksander Ɓukasz Date: Thu, 24 Oct 2013 08:06:15 +0000 (+0200) Subject: Allow for muting contentSet event in smartxml.loadXML if desired X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/1eebf7be27d533a4b8ca1dba2c64e574dee8e17d?hp=d61535cf50c7a8cb597db7f1d9681901a06efaa5 Allow for muting contentSet event in smartxml.loadXML if desired --- diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index f4aa9fe..b81b0f0 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -242,10 +242,12 @@ $.extend(Document.prototype, Backbone.Events, { return new this.TextNodeFactory(nativeNode, this); }, - loadXML: function(xml) { + loadXML: function(xml, options) { + options = options || {}; defineDocumentProperties(this, $(parseXML(xml))); - - this.trigger('contentSet'); + if(!options.silent) { + this.trigger('contentSet'); + } }, toXML: function() {