aboutsummaryrefslogtreecommitdiff
path: root/js/stage
diff options
context:
space:
mode:
authorAnanya Sen2012-06-26 13:06:43 -0700
committerAnanya Sen2012-06-26 13:06:43 -0700
commitfc9186b7400dcc2b25c264a2f245603b73d2e429 (patch)
treec94b7b3e4bfe2726300a8dec0b8841ba4d6bf109 /js/stage
parent6075916ef18dc4a8cbea41c941d2d0b519360262 (diff)
parent8821e662484aedb027e26a873883e6ca3fb55a51 (diff)
downloadninja-fc9186b7400dcc2b25c264a2f245603b73d2e429.tar.gz
Merge branch 'refs/heads/ninja-internal-master' into bugfix-master
Diffstat (limited to 'js/stage')
-rwxr-xr-xjs/stage/stage.reel/stage.js33
1 files changed, 30 insertions, 3 deletions
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js
index 319ffe87..14bc00eb 100755
--- a/js/stage/stage.reel/stage.js
+++ b/js/stage/stage.reel/stage.js
@@ -358,8 +358,6 @@ exports.Stage = Montage.create(Component, {
358 // Hide the canvas 358 // Hide the canvas
359 this.hideCanvas(true); 359 this.hideCanvas(true);
360 360
361 this.eventManager.addEventListener( "appMouseUp", this, false);
362
363 this.eventManager.addEventListener( "enableStageMove", this, false); 361 this.eventManager.addEventListener( "enableStageMove", this, false);
364 this.eventManager.addEventListener( "disableStageMove", this, false); 362 this.eventManager.addEventListener( "disableStageMove", this, false);
365 363
@@ -479,6 +477,7 @@ exports.Stage = Montage.create(Component, {
479 477
480 enableMouseInOut: { 478 enableMouseInOut: {
481 value: function() { 479 value: function() {
480 document.addEventListener("mouseup", this, true);
482 this._drawingCanvas.addEventListener("mouseout", this, false); 481 this._drawingCanvas.addEventListener("mouseout", this, false);
483 this._drawingCanvas.addEventListener("mouseover", this, false); 482 this._drawingCanvas.addEventListener("mouseover", this, false);
484 } 483 }
@@ -491,6 +490,19 @@ exports.Stage = Montage.create(Component, {
491 } 490 }
492 }, 491 },
493 492
493 captureMouseup: {
494 value: function(event) {
495 var target = event._event.target.getAttribute("data-montage-id");
496
497 if(target && target === "drawingCanvas") {
498 return true;
499 } else {
500 this.handleAppMouseUp(event);
501 return true;
502 }
503 }
504 },
505
494 handleMouseout: { 506 handleMouseout: {
495 value: function(event) { 507 value: function(event) {
496 this.outFlag = true; 508 this.outFlag = true;
@@ -505,6 +517,11 @@ exports.Stage = Montage.create(Component, {
505 517
506 handleMousedown: { 518 handleMousedown: {
507 value: function(event) { 519 value: function(event) {
520
521 // Increase the canvas to cover the scroll bars
522 this._drawingCanvas.height = this._drawingCanvas.height + 11;
523 this._drawingCanvas.width = this._drawingCanvas.width + 11;
524
508 // Call the focus manager to set focus to blur any focus'd elements 525 // Call the focus manager to set focus to blur any focus'd elements
509 this.focusManager.setFocus(); 526 this.focusManager.setFocus();
510 527
@@ -534,13 +551,18 @@ exports.Stage = Montage.create(Component, {
534 551
535 handleMouseup: { 552 handleMouseup: {
536 value: function(event) { 553 value: function(event) {
554 // Restore canvas to un-cover the scroll bars.
555 this._drawingCanvas.height = this._drawingCanvas.height - 11;
556 this._drawingCanvas.width = this._drawingCanvas.width - 11;
537 // If the mouse up comes from dismissing the context menu return 557 // If the mouse up comes from dismissing the context menu return
558
538 if(this.contextMenu) { 559 if(this.contextMenu) {
539 this.contextMenu = false; 560 this.contextMenu = false;
540 return; 561 return;
541 } 562 }
542 563
543 //this.disableMouseInOut(); 564 this.disableMouseInOut();
565 document.removeEventListener("mouseup", this, true);
544 566
545 this.application.ninja.toolsData.selectedToolInstance.HandleLeftButtonUp(event); 567 this.application.ninja.toolsData.selectedToolInstance.HandleLeftButtonUp(event);
546 568
@@ -588,12 +610,17 @@ exports.Stage = Montage.create(Component, {
588 handleAppMouseUp: { 610 handleAppMouseUp: {
589 value: function(event) { 611 value: function(event) {
590 if(this.outFlag) { 612 if(this.outFlag) {
613 this._drawingCanvas.height = this._drawingCanvas.height - 11;
614 this._drawingCanvas.width = this._drawingCanvas.width - 11;
615
591 if(this.application.ninja.toolsData.selectedToolInstance.isDrawing) { 616 if(this.application.ninja.toolsData.selectedToolInstance.isDrawing) {
592 this.application.ninja.toolsData.selectedToolInstance.HandleLeftButtonUp(event); 617 this.application.ninja.toolsData.selectedToolInstance.HandleLeftButtonUp(event);
593 } 618 }
594 this.disableMouseInOut(); 619 this.disableMouseInOut();
595 this.outFlag = false; 620 this.outFlag = false;
596 } 621 }
622
623 document.removeEventListener("mouseup", this, true);
597 } 624 }
598 }, 625 },
599 626