smartxml: transaction wrapper
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 27 Jan 2014 10:51:39 +0000 (11:51 +0100)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 27 Jan 2014 10:51:39 +0000 (11:51 +0100)
src/smartxml/smartxml.js

index d87ec54..d085742 100644 (file)
@@ -574,6 +574,12 @@ $.extend(Document.prototype, Backbone.Events, {
         }
     },
 
+    transaction: function(callback, context) {
+        this.startTransaction();
+        callback.call(context);
+        this.endTransaction();
+    },
+
     getNodeByPath: function(path) {
         var toret = this.root;
         path.forEach(function(idx) {