small fixes to be sure the project and the view are loaded before using it
authorrougeronj
Mon, 14 Sep 2015 11:48:24 +0200
changeset 516 7d1d44b53af5
parent 515 5fbcc117e8fe
child 517 15061185cf1b
small fixes to be sure the project and the view are loaded before using it
client/js/full-json.js
client/js/save-once.js
--- a/client/js/full-json.js	Fri Sep 11 16:34:41 2015 +0200
+++ b/client/js/full-json.js	Mon Sep 14 11:48:24 2015 +0200
@@ -19,7 +19,6 @@
                 saveStatus : 0
             });
             _renkan.renderer.redrawActive = true;
-            _renkan.renderer.fixSize();
         });
     };
     var _save = function() {
@@ -45,6 +44,9 @@
     var _thrSave = Rkns._.throttle(function() {
         setTimeout(_save, 100);
     }, 1000);
+    
+    //TODO: Rearrange to avoid the 2 firts PUT due to a change in the project model
+    // Take car of setting up the listener correctly to listen the save action on the view
     _proj.on("add:nodes add:edges add:users add:views", function(_model) {
         _model.on("change remove", function(_model) {
             _thrSave();
--- a/client/js/save-once.js	Fri Sep 11 16:34:41 2015 +0200
+++ b/client/js/save-once.js	Mon Sep 14 11:48:24 2015 +0200
@@ -20,13 +20,14 @@
             url: _opts.url,
             data: getdata,
             beforeSend: function(){
+                _renkan.renderer.redrawActive = false;
             	_proj.set({loadingStatus:true});
             },
             success: function(_data) {
                 _renkan.dataloader.load(_data);
                 _proj.set({loadingStatus:false});
                 _proj.set({saveStatus:0});
-                _renkan.renderer.autoScale();
+                _renkan.renderer.redrawActive = true;
             }
         });
     };