diff options
author | Valerio Virgillito | 2012-07-19 18:21:45 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-07-19 18:21:45 -0700 |
commit | 6d38a574e4f6ed7dbb0a5d033fc2f3766dd5fc98 (patch) | |
tree | c0d1688ec3d8426295bd315cece84f2f611872a1 /js/stage | |
parent | 4b1a4b6b424400080271202800d2de78e5509708 (diff) | |
parent | 6403ec6d21048c93138ddcbcc59fc4677121ed5e (diff) | |
download | ninja-6d38a574e4f6ed7dbb0a5d033fc2f3766dd5fc98.tar.gz |
Merge branch 'timeline-play' of https://github.com/mencio/ninja into v0.7.1
Diffstat (limited to 'js/stage')
-rwxr-xr-x | js/stage/stage.reel/stage.js | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 7ac64976..b7235d19 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js | |||
@@ -1349,6 +1349,70 @@ exports.Stage = Montage.create(Component, { | |||
1349 | 1349 | ||
1350 | this.drawUtils.initializeFromDocument(adjustScrollOffsets); | 1350 | this.drawUtils.initializeFromDocument(adjustScrollOffsets); |
1351 | } | 1351 | } |
1352 | }, | ||
1353 | |||
1354 | _timelinePlay: { | ||
1355 | value: false | ||
1356 | }, | ||
1357 | |||
1358 | timelinePlay: { | ||
1359 | get: function() { | ||
1360 | return this._timelinePlay; | ||
1361 | }, | ||
1362 | set: function(value) { | ||
1363 | if(this._timelinePlay !== value) { | ||
1364 | this._timelinePlay = value; | ||
1365 | this._timelinePlay ? this.playTimeline() : this.stopTimeline(); | ||
1366 | } | ||
1367 | } | ||
1368 | }, | ||
1369 | |||
1370 | playTimeline: { | ||
1371 | value: function() { | ||
1372 | this._canvas.style.visibility = "hidden"; | ||
1373 | this._layoutCanvas.style.visibility = "hidden"; | ||
1374 | this._gridCanvas.style.visibility = "hidden"; | ||
1375 | |||
1376 | this._drawingCanvas.removeEventListener("mousedown", this, false); | ||
1377 | this._drawingCanvas.removeEventListener("mouseup", this, false); | ||
1378 | this._drawingCanvas.removeEventListener("dblclick", this, false); | ||
1379 | this._drawingCanvas.removeEventListener("mousewheel", this, false); | ||
1380 | this._drawingCanvas.removeEventListener("mousemove", this, false); | ||
1381 | |||
1382 | this.clearDrawingCanvas(); | ||
1383 | this._drawingContext.save(); | ||
1384 | this._drawingContext.strokeStyle = "rgba(255,0,0,1)"; | ||
1385 | this._drawingContext.lineWidth = 4; | ||
1386 | |||
1387 | this._drawingContext.strokeRect(0, 0, this._drawingCanvas.width, this._drawingCanvas.height); | ||
1388 | |||
1389 | document.removeEventListener("keydown", this, false); | ||
1390 | document.removeEventListener("keyup", this, false); | ||
1391 | this.bindingView.hide = true; | ||
1392 | this.application.ninja.stylesController._stageStylesheet.rules[0].selectorText = "nj-css-garbage-selector"; | ||
1393 | } | ||
1394 | }, | ||
1395 | |||
1396 | stopTimeline: { | ||
1397 | value: function() { | ||
1398 | this._canvas.style.visibility = "visible"; | ||
1399 | this._layoutCanvas.style.visibility = "visible"; | ||
1400 | this._gridCanvas.style.visibility = "visible"; | ||
1401 | |||
1402 | this._drawingCanvas.addEventListener("mousedown", this, false); | ||
1403 | this._drawingCanvas.addEventListener("mouseup", this, false); | ||
1404 | this._drawingCanvas.addEventListener("dblclick", this, false); | ||
1405 | this._drawingCanvas.addEventListener("mousewheel", this, false); | ||
1406 | this._drawingCanvas.addEventListener("mousemove", this, false); | ||
1407 | |||
1408 | this.clearDrawingCanvas(); | ||
1409 | this._drawingContext.restore(); | ||
1410 | |||
1411 | document.addEventListener("keydown", this, false); | ||
1412 | document.addEventListener("keyup", this, false); | ||
1413 | this.bindingView.hide = false; | ||
1414 | this.application.ninja.stylesController._stageStylesheet.rules[0].selectorText = "*"; | ||
1415 | } | ||
1352 | } | 1416 | } |
1353 | 1417 | ||
1354 | }); \ No newline at end of file | 1418 | }); \ No newline at end of file |