| changeset 555 | 49daeea94e88 |
| parent 554 | 32c7378d1c28 |
| child 557 | 18c36f038e9f |
| 554:32c7378d1c28 | 555:49daeea94e88 |
|---|---|
1 |
1 |
2 define(['jquery', 'underscore', 'filesaver', 'requtils', 'renderer/miniframe'], function ($, _, filesaver, requtils, MiniFrame) { |
2 define(['jquery', 'underscore', 'filesaver', 'requtils', 'renderer/miniframe', 'screenfull'], function ($, _, filesaver, requtils, MiniFrame, Screenfull) { |
3 'use strict'; |
3 'use strict'; |
4 |
4 |
5 var Utils = requtils.getUtils(); |
5 var Utils = requtils.getUtils(); |
6 |
6 |
7 /* Scene Begin */ |
7 /* Scene Begin */ |
8 |
8 |
9 var Scene = function(_renkan) { |
9 var Scene = function(_renkan) { |
238 function() { _this.$.find(".Rk-UserList").slideDown(); } |
238 function() { _this.$.find(".Rk-UserList").slideDown(); } |
239 ); |
239 ); |
240 this.$.find(".Rk-Users").mouseleave( |
240 this.$.find(".Rk-Users").mouseleave( |
241 function() { _this.$.find(".Rk-UserList").slideUp(); } |
241 function() { _this.$.find(".Rk-UserList").slideUp(); } |
242 ); |
242 ); |
243 |
|
244 if (Screenfull.enabled){ |
|
245 bindClick(".Rk-FullScreen-Button", "fullScreen"); |
|
246 } else { |
|
247 this.$.find(".Rk-FullScreen-Button").addClass("disabled"); |
|
248 this.$.find(".Rk-FullScreen-Button .Rk-TopBar-Tooltip-Contents").html(this.renkan.translate("Fullscreen not supported by your browser")); |
|
249 } |
|
250 |
|
243 bindClick(".Rk-FullScreen-Button", "fullScreen"); |
251 bindClick(".Rk-FullScreen-Button", "fullScreen"); |
244 bindClick(".Rk-AddNode-Button", "addNodeBtn"); |
252 bindClick(".Rk-AddNode-Button", "addNodeBtn"); |
245 bindClick(".Rk-AddEdge-Button", "addEdgeBtn"); |
253 bindClick(".Rk-AddEdge-Button", "addEdgeBtn"); |
246 bindClick(".Rk-Save-Button", "save"); |
254 bindClick(".Rk-Save-Button", "save"); |
247 bindClick(".Rk-Open-Button", "open"); |
255 bindClick(".Rk-Open-Button", "open"); |
1101 if (_event.type === "drop") { |
1109 if (_event.type === "drop") { |
1102 _repr.openEditor(); |
1110 _repr.openEditor(); |
1103 } |
1111 } |
1104 }, |
1112 }, |
1105 fullScreen: function() { |
1113 fullScreen: function() { |
1106 var _isFull = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen, |
1114 if (Screenfull.isFullscreen) { |
1107 _el = this.renkan.$[0], |
1115 Screenfull.exit(); |
1108 _requestMethods = ["requestFullScreen","mozRequestFullScreen","webkitRequestFullScreen"], |
1116 |
1109 _cancelMethods = ["cancelFullScreen","mozCancelFullScreen","webkitCancelFullScreen"], |
|
1110 i; |
|
1111 if (_isFull) { |
|
1112 for (i = 0; i < _cancelMethods.length; i++) { |
|
1113 if (typeof document[_cancelMethods[i]] === "function") { |
|
1114 document[_cancelMethods[i]](); |
|
1115 break; |
|
1116 } |
|
1117 } |
|
1118 var widthAft = this.$.width(); |
1117 var widthAft = this.$.width(); |
1119 var heightAft = this.$.height(); |
1118 var heightAft = this.$.height(); |
1120 |
1119 |
1121 if (this.renkan.options.show_top_bar) { |
1120 if (this.renkan.options.show_top_bar) { |
1122 heightAft -= this.$.find(".Rk-TopBar").height(); |
1121 heightAft -= this.$.find(".Rk-TopBar").height(); |
1126 } |
1125 } |
1127 |
1126 |
1128 paper.view.viewSize = new paper.Size([widthAft, heightAft]); |
1127 paper.view.viewSize = new paper.Size([widthAft, heightAft]); |
1129 |
1128 |
1130 } else { |
1129 } else { |
1131 for (i = 0; i < _requestMethods.length; i++) { |
1130 Screenfull.request(); |
1132 if (typeof _el[_requestMethods[i]] === "function") { |
1131 |
1133 _el[_requestMethods[i]](); |
|
1134 break; |
|
1135 } |
|
1136 } |
|
1137 this.redraw(); |
1132 this.redraw(); |
1138 } |
1133 } |
1139 }, |
1134 }, |
1140 addNodeBtn: function() { |
1135 addNodeBtn: function() { |
1141 if (this.click_mode === Utils._CLICKMODE_ADDNODE) { |
1136 if (this.click_mode === Utils._CLICKMODE_ADDNODE) { |