aboutsummaryrefslogtreecommitdiff
path: root/js/stage
diff options
context:
space:
mode:
authorValerio Virgillito2012-07-19 15:53:54 -0700
committerValerio Virgillito2012-07-19 15:53:54 -0700
commit6403ec6d21048c93138ddcbcc59fc4677121ed5e (patch)
tree43d371557e28383fb962cb86d1a478f3a35d7ff3 /js/stage
parentfc13ef1e806116bb7ece5bb06604fa4f5714a6ed (diff)
downloadninja-6403ec6d21048c93138ddcbcc59fc4677121ed5e.tar.gz
Timeline: updated livePreview to timeline play. Hide canvas and draw red outline
- Changed the play button to a toggle button - livePreview code in stage activated via bindings - Draw a red outline of the canvas when in play Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/stage')
-rwxr-xr-xjs/stage/stage.reel/stage.js64
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