# HG changeset patch # User rougeronj # Date 1442312698 -7200 # Node ID 0d9b3f1b97e707b53481fb3ab0a8376cb56296b2 # Parent f14ff86690374eaeac5cabb2569fc7512875a33f 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 diff -r f14ff8669037 -r 0d9b3f1b97e7 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() } );