diff -r a8f02d66bf02 -r 4a48a1a9fd1e client/js/renderer/scene.js --- a/client/js/renderer/scene.js Thu Jun 25 18:09:49 2015 +0200 +++ b/client/js/renderer/scene.js Tue Aug 04 18:02:54 2015 +0200 @@ -829,10 +829,6 @@ this.selected_target = null; } }, - paperShift: function(_delta) { - this.view.offset = this.view.offset.add(_delta); - this.redraw(); - }, onMouseMove: function(_event) { var _off = this.canvas_$.offset(), _point = new paper.Point([ @@ -849,7 +845,7 @@ if (this.click_target && typeof this.click_target.paperShift === "function") { this.click_target.paperShift(_delta); } else { - this.paperShift(_delta); + this.view.paperShift(_delta); } } else { this.findTarget(_hitResult); @@ -922,6 +918,7 @@ if (_isTouch) { this.unselectAll(); } + this.view.updateUrl(); } paper.view.draw(); }, @@ -1207,22 +1204,16 @@ this.view = this.addRepresentation("View", this.renkan.project.get("views").last()); return; } - if (typeof _params.idnode !== 'undefined'){ - console.log('params idnode'); - this.unhighlightAll(); - this.highlightModel(this.renkan.project.get("nodes").get(_params.idnode)); - } if (typeof _params.view !== 'undefined'){ var viewParams = _params.view.split(","); if (viewParams.length >= 3){ var params = { - "project": this.renkan.project, - "zoom_level": parseFloat(viewParams[0]), - "offset": { - "x": parseFloat(viewParams[1]), - "y": parseFloat(viewParams[2]) - }, - "hidden_nodes": [] + "project": this.renkan.project, + "offset": { + "x": parseFloat(viewParams[0]), + "y": parseFloat(viewParams[1]) + }, + "zoom_level": parseFloat(viewParams[2]) }; for (var i = 3; i < viewParams.length; i++){ params.hidden_nodes.push(viewParams[i]); @@ -1241,6 +1232,11 @@ this.view = this.addRepresentation("View", this.renkan.project.get("views").last()); } } + //other parameters must go after because most of them depends on a view that must be initialize before + if (typeof _params.idNode !== 'undefined'){ + this.unhighlightAll(); + this.highlightModel(this.renkan.project.get("nodes").get(_params.iNnode)); + } }, foldBins: function() { var foldBinsButton = this.$.find(".Rk-Fold-Bins"),