client/js/save-once.js
changeset 447 e246651b6626
parent 368 3abc79964948
child 455 18b9be54174d
--- a/client/js/save-once.js	Tue May 05 18:00:13 2015 +0200
+++ b/client/js/save-once.js	Wed May 06 10:38:01 2015 +0200
@@ -20,13 +20,13 @@
             url: _opts.url,
             data: getdata,
             beforeSend: function(){
-            	_proj.set({loading_status:true});
+                _proj.set({loading_status:true});
             },
             success: function(_data) {
                 _proj.set(_data, {validate: true});
-            	_proj.set({loading_status:false});
+                _proj.set({loading_status:false});
                 _proj.set({save_status:0});
-            	_renkan.renderer.autoScale();
+                _renkan.renderer.autoScale();
             }
         });
     };
@@ -39,7 +39,7 @@
             contentType: "application/json",
             data: JSON.stringify(_data),
             beforeSend: function(){
-            	_proj.set({save_status:2});
+                _proj.set({save_status:2});
             },
             success: function(data, textStatus, jqXHR) {
                 $(window).off("beforeunload", _onLeave);
@@ -51,8 +51,8 @@
         });
     };
     var _checkLeave = function() {
-    	_proj.set({save_status:1});
-    	
+        _proj.set({save_status:1});
+        
         var title = _proj.get("title");
         if (title && _proj.get("nodes").length) {
             $(".Rk-Save-Button").removeClass("disabled");
@@ -69,14 +69,14 @@
     };
     _load();
     _proj.on("add:nodes add:edges add:users change", function(_model) {
-	    _model.on("change remove", function(_model) {
-	    	if(!(_model.changedAttributes.length === 1 && _model.hasChanged('save_status'))) {
-	    		_checkLeave();
-	    	}
-	    });
-		if(!(_proj.changedAttributes.length === 1 && _proj.hasChanged('save_status'))) {
-		    _checkLeave();
-    	}
+        _model.on("change remove", function(_model) {
+            if(!(_model.changedAttributes.length === 1 && _model.hasChanged('save_status'))) {
+                _checkLeave();
+            }
+        });
+        if(!(_proj.changedAttributes.length === 1 && _proj.hasChanged('save_status'))) {
+            _checkLeave();
+        }
     });
     _renkan.renderer.save = function() {
         if ($(".Rk-Save-Button").hasClass("disabled")) {