Allow for muting contentSet event in smartxml.loadXML if desired
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 24 Oct 2013 08:06:15 +0000 (10:06 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 24 Oct 2013 08:06:15 +0000 (10:06 +0200)
src/smartxml/smartxml.js

index f4aa9fe..b81b0f0 100644 (file)
@@ -242,10 +242,12 @@ $.extend(Document.prototype, Backbone.Events, {
         return new this.TextNodeFactory(nativeNode, this);
     },
 
         return new this.TextNodeFactory(nativeNode, this);
     },
 
-    loadXML: function(xml) {
+    loadXML: function(xml, options) {
+        options = options || {};
         defineDocumentProperties(this, $(parseXML(xml)));
         defineDocumentProperties(this, $(parseXML(xml)));
-        
-        this.trigger('contentSet');
+        if(!options.silent) {
+            this.trigger('contentSet');
+        }
     },
 
     toXML: function() {
     },
 
     toXML: function() {