diff options
Diffstat (limited to 'js/ninja.reel/ninja.js')
-rwxr-xr-x | js/ninja.reel/ninja.js | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 2a6e49f7..e29c5057 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js | |||
@@ -23,6 +23,80 @@ exports.Ninja = Montage.create(Component, { | |||
23 | value: null | 23 | value: null |
24 | }, | 24 | }, |
25 | 25 | ||
26 | _isResizing: { | ||
27 | value: false | ||
28 | }, | ||
29 | _resizedHeight : { | ||
30 | value: 0 | ||
31 | }, | ||
32 | _height: { | ||
33 | value: null | ||
34 | }, | ||
35 | |||
36 | height: { | ||
37 | get: function() { | ||
38 | return this._height; | ||
39 | }, | ||
40 | set: function(val) { | ||
41 | if(this._height != val) { | ||
42 | this._height = val; | ||
43 | this.needsDraw = true; | ||
44 | } | ||
45 | |||
46 | } | ||
47 | }, | ||
48 | |||
49 | _resizedWidth : { | ||
50 | value: 0 | ||
51 | }, | ||
52 | _width: { | ||
53 | value: null | ||
54 | }, | ||
55 | |||
56 | width: { | ||
57 | get: function() { | ||
58 | return this._width; | ||
59 | }, | ||
60 | set: function(val) { | ||
61 | if(this._width != val) { | ||
62 | this._width = val; | ||
63 | this.needsDraw = true; | ||
64 | } | ||
65 | |||
66 | } | ||
67 | }, | ||
68 | |||
69 | handleResizeStart: { | ||
70 | value:function(e) { | ||
71 | this.isResizing = true; | ||
72 | this.height = parseInt(this.timeline.element.offsetHeight); | ||
73 | this.width = parseInt(this.rightPanelContainer.offsetWidth); | ||
74 | this.needsDraw = true; | ||
75 | } | ||
76 | }, | ||
77 | |||
78 | handleResizeMove: { | ||
79 | value:function(e) { | ||
80 | this._resizedHeight = e._event.dY; | ||
81 | this._resizedWidth = e._event.dX; | ||
82 | console.log("resizing"); | ||
83 | this.stage.resizeCanvases = true; | ||
84 | this.needsDraw = true; | ||
85 | } | ||
86 | }, | ||
87 | |||
88 | handleResizeEnd: { | ||
89 | value: function(e) { | ||
90 | this.height -= this._resizedHeight; | ||
91 | this.width -= this._resizedWidth; | ||
92 | this.stage.resizeCanvases = true; | ||
93 | this._resizedHeight = 0; | ||
94 | this._resizedWidth = 0; | ||
95 | this.isResizing = false; | ||
96 | this.needsDraw = true; | ||
97 | } | ||
98 | }, | ||
99 | |||
26 | selectedElements: { | 100 | selectedElements: { |
27 | value: [] | 101 | value: [] |
28 | }, | 102 | }, |
@@ -78,12 +152,45 @@ exports.Ninja = Montage.create(Component, { | |||
78 | } | 152 | } |
79 | }, | 153 | }, |
80 | 154 | ||
155 | willDraw: { | ||
156 | value: function() { | ||
157 | if (this.height === null) { | ||
158 | this.height = parseInt(this.timeline.element.offsetHeight); | ||
159 | } | ||
160 | if (this.width === null) { | ||
161 | this.width = parseInt(this.rightPanelContainer.offsetWidth); | ||
162 | } | ||
163 | } | ||
164 | }, | ||
165 | |||
166 | draw: { | ||
167 | value: function() { | ||
168 | if (this.height - this._resizedHeight < 30) { | ||
169 | this.timelineSplitter.collapsed = true; | ||
170 | } else { | ||
171 | this.timelineSplitter.collapsed = false; | ||
172 | } | ||
173 | if (this.width - this._resizedWidth < 30) { | ||
174 | this.panelSplitter.collapsed = true; | ||
175 | } else { | ||
176 | this.panelSplitter.collapsed = false; | ||
177 | } | ||
178 | |||
179 | this.timeline.element.style.height = (this.height - this._resizedHeight) + "px"; | ||
180 | this.rightPanelContainer.style.width = (this.width - this._resizedWidth) + "px"; | ||
181 | } | ||
182 | }, | ||
183 | |||
81 | _didDraw: { | 184 | _didDraw: { |
82 | value: false | 185 | value: false |
83 | }, | 186 | }, |
84 | 187 | ||
85 | didDraw: { | 188 | didDraw: { |
86 | value: function() { | 189 | value: function() { |
190 | if (!this.isResizing) { | ||
191 | this.height = this.timeline.element.offsetHeight; | ||
192 | this.width = this.rightPanelContainer.offsetWidth; | ||
193 | } | ||
87 | if(!this._didDraw) { | 194 | if(!this._didDraw) { |
88 | if (!this.application.ninja.coreIoApi.ioServiceDetected) { | 195 | if (!this.application.ninja.coreIoApi.ioServiceDetected) { |
89 | var check = this.application.ninja.coreIoApi.cloudAvailable(); | 196 | var check = this.application.ninja.coreIoApi.cloudAvailable(); |