240 var view = _this.renkan.project.get("views").last(); |
240 var view = _this.renkan.project.get("views").last(); |
241 if(view){ |
241 if(view){ |
242 _this.setScale(view.get("zoom_level"), new paper.Point(view.get("offset"))); |
242 _this.setScale(view.get("zoom_level"), new paper.Point(view.get("offset"))); |
243 } |
243 } |
244 }); |
244 }); |
245 if(this.renkan.project.get("views").length > 0 && !isNaN(parseInt(this.renkan.options.default_view))){ |
245 if(this.renkan.project.get("views").length > 0 && this.renkan.options.save_view){ |
246 this.$.find(".Rk-ZoomSetSaved").show(); |
246 this.$.find(".Rk-ZoomSetSaved").show(); |
247 } |
247 } |
248 this.$.find(".Rk-CurrentUser").mouseenter( |
248 this.$.find(".Rk-CurrentUser").mouseenter( |
249 function() { _this.$.find(".Rk-UserList").slideDown(); } |
249 function() { _this.$.find(".Rk-UserList").slideDown(); } |
250 ); |
250 ); |
390 _renkan.options.size_bug_fix |
390 _renkan.options.size_bug_fix |
391 : 500 |
391 : 500 |
392 ); |
392 ); |
393 window.setTimeout( |
393 window.setTimeout( |
394 function() { |
394 function() { |
395 _this.fixSize(true); |
395 _this.fixSize(); |
396 }, |
396 }, |
397 _delay |
397 _delay |
398 ); |
398 ); |
399 } |
399 } |
400 |
400 |
401 if (_renkan.options.force_resize) { |
401 if (_renkan.options.force_resize) { |
402 $(window).resize(function() { |
402 $(window).resize(function() { |
403 _this.fixSize(false); |
403 _this.autoScale(); |
404 }); |
404 }); |
405 } |
405 } |
406 |
406 |
407 if (_renkan.options.show_user_list && _renkan.options.user_color_editable) { |
407 if (_renkan.options.show_user_list && _renkan.options.user_color_editable) { |
408 var $cpwrapper = this.$.find(".Rk-Users .Rk-Edit-ColorPicker-Wrapper"), |
408 var $cpwrapper = this.$.find(".Rk-Users .Rk-Edit-ColorPicker-Wrapper"), |
514 '<form action="#" class="Rk-GraphSearch-Form"><input type="search" class="Rk-GraphSearch-Field" placeholder="<%- translate("Search in graph") %>" /></form><div class="Rk-TopBar-Separator"></div><% } %></div><% } %>' + |
514 '<form action="#" class="Rk-GraphSearch-Form"><input type="search" class="Rk-GraphSearch-Field" placeholder="<%- translate("Search in graph") %>" /></form><div class="Rk-TopBar-Separator"></div><% } %></div><% } %>' + |
515 '<div class="Rk-Editing-Space<% if (!options.show_top_bar) { %> Rk-Editing-Space-Full<% } %>">' + |
515 '<div class="Rk-Editing-Space<% if (!options.show_top_bar) { %> Rk-Editing-Space-Full<% } %>">' + |
516 '<div class="Rk-Labels"></div><canvas class="Rk-Canvas" <% if (options.resize) { %> resize="" <% } %>></canvas><div class="Rk-Notifications"></div><div class="Rk-Editor">' + |
516 '<div class="Rk-Labels"></div><canvas class="Rk-Canvas" <% if (options.resize) { %> resize="" <% } %>></canvas><div class="Rk-Notifications"></div><div class="Rk-Editor">' + |
517 '<% if (options.show_bins) { %><div class="Rk-Fold-Bins">«</div><% } %>' + |
517 '<% if (options.show_bins) { %><div class="Rk-Fold-Bins">«</div><% } %>' + |
518 '<% if (options.show_zoom) { %><div class="Rk-ZoomButtons"><div class="Rk-ZoomIn" title="<%-translate("Zoom In")%>"></div><div class="Rk-ZoomFit" title="<%-translate("Zoom Fit")%>"></div><div class="Rk-ZoomOut" title="<%-translate("Zoom Out")%>"></div>' + |
518 '<% if (options.show_zoom) { %><div class="Rk-ZoomButtons"><div class="Rk-ZoomIn" title="<%-translate("Zoom In")%>"></div><div class="Rk-ZoomFit" title="<%-translate("Zoom Fit")%>"></div><div class="Rk-ZoomOut" title="<%-translate("Zoom Out")%>"></div>' + |
519 '<% if (options.editor_mode && !isNaN(parseInt(options.default_view))) { %><div class="Rk-ZoomSave" title="<%-translate("Zoom Save")%>"></div><% } %>' + |
519 '<% if (options.editor_mode && options.save_view) { %><div class="Rk-ZoomSave" title="<%-translate("Zoom Save")%>"></div><% } %>' + |
520 '<% if (!isNaN(parseInt(options.default_view))) { %><div class="Rk-ZoomSetSaved" title="<%-translate("View saved zoom")%>"></div><% } %></div><% } %>' + |
520 '<% if (options.save_view) { %><div class="Rk-ZoomSetSaved" title="<%-translate("View saved zoom")%>"></div><% } %></div><% } %>' + |
521 '</div></div>' |
521 '</div></div>' |
522 ), |
522 ), |
523 fixSize: function(_autoscale) { |
523 fixSize: function() { |
524 |
524 if( this.renkan.options.default_view && this.renkan.project.get("views").length > 0) { |
525 if (_autoscale) { |
525 var view = this.renkan.project.get("views").last(); |
526 // If _autoscale, we get the initial view (zoom+offset) set in the project datas. |
526 this.setScale(view.get("zoom_level"), new paper.Point(view.get("offset"))); |
527 if(this.renkan.read_only && !isNaN(parseInt(this.renkan.options.default_view))){ |
527 } |
528 this.autoScale(this.renkan.project.get("views")[parseInt(this.renkan.options.default_view)]); |
528 else{ |
529 } |
529 this.autoScale(); |
530 else{ |
|
531 this.autoScale(); |
|
532 } |
|
533 } |
530 } |
534 }, |
531 }, |
535 drawSector: function(_repr, _inR, _outR, _startAngle, _endAngle, _padding, _imgname, _caption) { |
532 drawSector: function(_repr, _inR, _outR, _startAngle, _endAngle, _padding, _imgname, _caption) { |
536 var _options = this.renkan.options, |
533 var _options = this.renkan.options, |
537 _startRads = _startAngle * Math.PI / 180, |
534 _startRads = _startAngle * Math.PI / 180, |