client/js/renderer/scene.js
changeset 486 f1ff0529ba41
parent 481 66c3b474a331
child 487 48be7ebb3187
equal deleted inserted replaced
485:a95d4a631bcf 486:f1ff0529ba41
   242             _this.renkan.project.addView( { zoom_level:_this.scale, offset:_this.offset, hidden_nodes: _this.hiddenNodes } );
   242             _this.renkan.project.addView( { zoom_level:_this.scale, offset:_this.offset, hidden_nodes: _this.hiddenNodes } );
   243         });
   243         });
   244         this.$.find(".Rk-ZoomSetSaved").click( function() {
   244         this.$.find(".Rk-ZoomSetSaved").click( function() {
   245             var view = _this.renkan.project.get("views").last();
   245             var view = _this.renkan.project.get("views").last();
   246             if(view){
   246             if(view){
       
   247                 _this.showNodes(false);
   247                 _this.setScale(view.get("zoom_level"), new paper.Point(view.get("offset")));
   248                 _this.setScale(view.get("zoom_level"), new paper.Point(view.get("offset")));
   248                 _this.hiddenNodes = view.get("hidden_nodes") || [];
   249                 _this.hiddenNodes = (view.get("hidden_nodes") || []).concat();
   249                 _this.hideNodes();
   250                 _this.hideNodes();
   250             }
   251             }
   251         });
   252         });
   252         this.$.find(".Rk-ShowHiddenNodes").mouseenter( function() {
   253         this.$.find(".Rk-ShowHiddenNodes").mouseenter( function() {
   253             _this.showNodes(true);
   254             _this.showNodes(true);
   254             _this.$.find(".Rk-ShowHiddenNodes").mouseleave( function() {
   255             _this.$.find(".Rk-ShowHiddenNodes").mouseleave( function() {
   255                 _this.hideNodes(false);
   256                 _this.hideNodes();
   256             });
   257             });
   257         });
   258         });
   258         this.$.find(".Rk-ShowHiddenNodes").click( function() {
   259         this.$.find(".Rk-ShowHiddenNodes").click( function() {
   259             _this.showNodes(false);
   260             _this.showNodes(false);
   260             _this.$.find(".Rk-ShowHiddenNodes").off( "mouseleave" );
   261             _this.$.find(".Rk-ShowHiddenNodes").off( "mouseleave" );
   895             });
   896             });
   896             paper.view.draw();
   897             paper.view.draw();
   897         },
   898         },
   898         showNodes: function(ghost){
   899         showNodes: function(ghost){
   899             var _this = this;
   900             var _this = this;
       
   901             var i = 0;
   900             this.hiddenNodes.forEach(function(_id){
   902             this.hiddenNodes.forEach(function(_id){
       
   903                 i++;
   901                 _this.getRepresentationByModel(_this.renkan.project.get("nodes").get(_id)).show(ghost);
   904                 _this.getRepresentationByModel(_this.renkan.project.get("nodes").get(_id)).show(ghost);
   902             });
   905             });
   903             if (!ghost){
   906             if (!ghost){
   904                 this.hiddenNodes = [];
   907                 this.hiddenNodes = [];
   905             }
   908             }