client/js/full-json.js
changeset 114 110f99eb417e
parent 105 810a1c1015df
child 116 07f9fc847d5d
--- a/client/js/full-json.js	Tue Mar 26 16:14:19 2013 +0100
+++ b/client/js/full-json.js	Tue Mar 26 19:12:05 2013 +0100
@@ -10,32 +10,33 @@
             _proj.set(_data, {validate: true});
         });
     }
-    if (!_renkan.read_only) {
-        var _save = function() {
-            var _data = _proj.toJSON();
-            Rkns.$.ajax({
-                type: _opts.http_method,
-                url: _opts.url,
-                contentType: "application/json",
-                data: JSON.stringify(_data),
-                success: function(data, textStatus, jqXHR) {
-                }
-            });
-            
+    var _save = function() {
+        var _data = _proj.toJSON();
+        if (!_renkan.read_only) {
+        	Rkns.$.ajax({
+	            type: _opts.http_method,
+	            url: _opts.url,
+	            contentType: "application/json",
+	            data: JSON.stringify(_data),
+	            success: function(data, textStatus, jqXHR) {
+	            }
+	        });
         }
-        var _thrSave = Rkns._.throttle(
-            function() {
-                setTimeout(_save, 100)
-            }, 1000);
-        _proj.on("add:nodes add:edges add:users", function(_model) {
-            _model.on("change remove", function(_model) {
-                _thrSave();
-            });
+        
+    }
+    var _thrSave = Rkns._.throttle(
+        function() {
+            setTimeout(_save, 100)
+        }, 1000);
+    _proj.on("add:nodes add:edges add:users", function(_model) {
+        _model.on("change remove", function(_model) {
             _thrSave();
         });
-        _proj.on("change", function() {
-            _thrSave();
-        });
-    }
+        _thrSave();
+    });
+    _proj.on("change", function() {
+        _thrSave();
+    });
+        
     _load();
 }