client/js/renderer/scene.js
changeset 557 18c36f038e9f
parent 555 49daeea94e88
child 560 05a4380227f3
equal deleted inserted replaced
556:2737bc21e6dd 557:18c36f038e9f
   288             if (newHeight < newWidth) {
   288             if (newHeight < newWidth) {
   289                     _ratio = ratioH;
   289                     _ratio = ratioH;
   290             } else {
   290             } else {
   291                 _ratio = ratioW;
   291                 _ratio = ratioW;
   292             }
   292             }
   293             _this.view.resizeZoom(ratioW, ratioH, _ratio);
   293             _this.view.resizeZoom(_event.delta.width, _event.delta.height, _ratio);
   294 
   294 
   295             _this.redraw();
   295             _this.redraw();
   296 
   296 
   297         };
   297         };
   298 
   298 
  1109             if (_event.type === "drop") {
  1109             if (_event.type === "drop") {
  1110                 _repr.openEditor();
  1110                 _repr.openEditor();
  1111             }
  1111             }
  1112         },
  1112         },
  1113         fullScreen: function() {
  1113         fullScreen: function() {
       
  1114             var _el = this.renkan.$[0];
       
  1115             
  1114             if (Screenfull.isFullscreen) {
  1116             if (Screenfull.isFullscreen) {
  1115                 Screenfull.exit();
  1117                 Screenfull.exit(_el);
  1116             
  1118             
  1117                 var widthAft = this.$.width();
  1119                 var widthAft = this.$.width();
  1118                 var heightAft = this.$.height();
  1120                 var heightAft = this.$.height();
  1119 
  1121 
  1120                 if (this.renkan.options.show_top_bar) {
  1122                 if (this.renkan.options.show_top_bar) {
  1125                 }
  1127                 }
  1126 
  1128 
  1127                 paper.view.viewSize = new paper.Size([widthAft, heightAft]);
  1129                 paper.view.viewSize = new paper.Size([widthAft, heightAft]);
  1128 
  1130 
  1129             } else {
  1131             } else {
  1130                 Screenfull.request();
  1132                 Screenfull.request(_el);
  1131                 
  1133                 
  1132                 this.redraw();
  1134                 this.redraw();
  1133             }
  1135             }
  1134         },
  1136         },
  1135         addNodeBtn: function() {
  1137         addNodeBtn: function() {
  1254             }
  1256             }
  1255             return validIndex;
  1257             return validIndex;
  1256         },
  1258         },
  1257         foldBins: function() {
  1259         foldBins: function() {
  1258             var foldBinsButton = this.$.find(".Rk-Fold-Bins"),
  1260             var foldBinsButton = this.$.find(".Rk-Fold-Bins"),
  1259                 bins = this.renkan.$.find(".Rk-Bins");
  1261                 bins = this.renkan.$.find(".Rk-Bins"),
       
  1262                 _delta = 0;
  1260             var _this = this,
  1263             var _this = this,
  1261                 sizeBef = _this.canvas_$.width(),
  1264                 sizeBef = _this.canvas_$.width(),
  1262                 sizeAft;
  1265                 sizeAft;
  1263             if (bins.position().left < 0) {
  1266             if (bins.position().left < 0) {
       
  1267                 _delta= new paper.Point([-bins.width()/2, 0]);
  1264                 bins.animate({left: 0},250);
  1268                 bins.animate({left: 0},250);
  1265                 this.$.animate({left: 300},250,function() {
  1269                 this.$.animate({left: 300},250,function() {
  1266                     var w = _this.$.width();
  1270                     var w = _this.$.width();
  1267                     paper.view.viewSize = new paper.Size([w, _this.canvas_$.height()]);
  1271                     paper.view.viewSize = new paper.Size([w, _this.canvas_$.height()]);
  1268                 });
  1272                 });
  1271                 } else {
  1275                 } else {
  1272                     sizeAft = sizeBef - bins.width();
  1276                     sizeAft = sizeBef - bins.width();
  1273                 }
  1277                 }
  1274                 foldBinsButton.html("&laquo;");
  1278                 foldBinsButton.html("&laquo;");
  1275             } else {
  1279             } else {
       
  1280                 _delta= new paper.Point([bins.width()/2, 0]);
  1276                 bins.animate({left: -300},250);
  1281                 bins.animate({left: -300},250);
  1277                 this.$.animate({left: 0},250,function() {
  1282                 this.$.animate({left: 0},250,function() {
  1278                     var w = _this.$.width();
  1283                     var w = _this.$.width();
  1279                     paper.view.viewSize = new paper.Size([w, _this.canvas_$.height()]);
  1284                     paper.view.viewSize = new paper.Size([w, _this.canvas_$.height()]);
  1280                 });
  1285                 });
  1281                 sizeAft = sizeBef+300;
  1286                 sizeAft = sizeBef+300;
  1282                 foldBinsButton.html("&raquo;");
  1287                 foldBinsButton.html("&raquo;");
  1283             }
  1288             }
       
  1289             this.view.paperShift(_delta);
  1284         },
  1290         },
  1285         save: function() { },
  1291         save: function() { },
  1286         open: function() { }
  1292         open: function() { }
  1287     }).value();
  1293     }).value();
  1288 
  1294