1794 |
1794 |
1795 bindClick(".Rk-ZoomOut", "zoomOut"); |
1795 bindClick(".Rk-ZoomOut", "zoomOut"); |
1796 bindClick(".Rk-ZoomIn", "zoomIn"); |
1796 bindClick(".Rk-ZoomIn", "zoomIn"); |
1797 bindClick(".Rk-ZoomFit", "autoScale"); |
1797 bindClick(".Rk-ZoomFit", "autoScale"); |
1798 this.$.find(".Rk-ZoomSave").click( function() { |
1798 this.$.find(".Rk-ZoomSave").click( function() { |
1799 _this.renkan.project.set("views", [{id:Rkns.Utils.getUID('view'), zoom_level:_this.scale, offset_x:_this.offset.x, offset_y:_this.offset.y}]); // Save scale |
1799 // Save scale and offset point |
|
1800 _this.renkan.project.addView( { id:Rkns.Utils.getUID('view'), zoom_level:_this.scale, offset_x:_this.offset.x, offset_y:_this.offset.y } ); |
1800 _this.$.find(".Rk-ZoomSetSaved").show(); |
1801 _this.$.find(".Rk-ZoomSetSaved").show(); |
1801 }); |
1802 }); |
1802 this.$.find(".Rk-ZoomSetSaved").click( function() { |
1803 this.$.find(".Rk-ZoomSetSaved").click( function() { |
1803 var view = _this.renkan.project.get("views")[0]; |
1804 var view = _this.renkan.project.get("views").last(); |
1804 _this.setScale(view.zoom_level, new paper.Point(view.offset_x, view.offset_y)); |
1805 if(view){ |
|
1806 _this.setScale(view.get("zoom_level"), new paper.Point(view.get("offset_x"), view.get("offset_y"))); |
|
1807 } |
1805 }); |
1808 }); |
1806 if(this.renkan.read_only && !isNaN(parseInt(this.renkan.options.default_view))){ |
1809 if(this.renkan.read_only && !isNaN(parseInt(this.renkan.options.default_view))){ |
1807 this.$.find(".Rk-ZoomSetSaved").show(); |
1810 this.$.find(".Rk-ZoomSetSaved").show(); |
1808 } |
1811 } |
1809 this.$.find(".Rk-CurrentUser").mouseenter( |
1812 this.$.find(".Rk-CurrentUser").mouseenter( |