Create new view id the current one isn't in the project or if it's the first one (so we let the first one always unchanged)
authorrougeronj
Tue, 15 Sep 2015 12:24:58 +0200
changeset 521 0d9b3f1b97e7
parent 520 f14ff8669037
child 522 1cb7122dd427
Create new view id the current one isn't in the project or if it's the first one (so we let the first one always unchanged) Otherwise modify the current one
client/js/renderer/viewrepr.js
--- a/client/js/renderer/viewrepr.js	Mon Sep 14 18:09:36 2015 +0200
+++ b/client/js/renderer/viewrepr.js	Tue Sep 15 12:24:58 2015 +0200
@@ -47,7 +47,7 @@
                     "y": _this.offset.y
                 };
                 //TODO: make the if else the same function
-                if (_this.model){
+                if (_this.model && _this.renkan.project.get("views").indexOf(_this.model) > 0){
                     _this.model.set( { zoom_level:_this.scale, offset:offset, hidden_nodes: _this.hiddenNodes.concat() } );
                 }else{
                     _this.model = _this.renkan.project.addView( { zoom_level:_this.scale, offset:offset, hidden_nodes: _this.hiddenNodes.concat() } );