From a7cb2c0b22f03b79f19d4a9a2eb691d1ccc392f9 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 14 Mar 2012 18:04:11 -0700 Subject: adding a focus manager to handle panel bugs where blur was not getting called when clicking on the canvas. Signed-off-by: Valerio Virgillito --- js/stage/stage.reel/stage.html | 7 ++++++- js/stage/stage.reel/stage.js | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'js/stage') diff --git a/js/stage/stage.reel/stage.html b/js/stage/stage.reel/stage.html index 812e3d55..f796303c 100755 --- a/js/stage/stage.reel/stage.html +++ b/js/stage/stage.reel/stage.html @@ -50,6 +50,10 @@ "element" : {"#": "textToolObject"} } }, + + "focusManager": { + "object": "js/components/focus-manager.reel" + }, "owner": { "module": "js/stage/stage.reel", @@ -63,7 +67,8 @@ "stageDeps": {"@": "StageDeps1"}, "layout": {"@": "layout1"}, "stageView": {"@": "stageView"}, - "textTool": {"@": "textTool"} + "textTool": {"@": "textTool"}, + "focusManager": {"@": "focusManager"} }, "bindings": { "currentDocumentStageView": { diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 4c1d046b..a624b2c6 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js @@ -319,6 +319,10 @@ exports.Stage = Montage.create(Component, { handleMousedown: { value: function(event) { + // Call the focus manager to set focus to blur any focus'd elements + this.focusManager.setFocus(); + + var point; // event.preventDefault(); // commenting because HTML elements in the IDE are retaining focus // If right click set the context menu to true to prevent a mouse up. -- cgit v1.2.3 From da5dfc8863ad47c48414ff1fdacbacdb91abd30c Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 14 Mar 2012 23:25:34 -0700 Subject: Fixing the splitter resize canvas bug by getting the size when a document is opened. Signed-off-by: Valerio Virgillito --- js/stage/stage.reel/stage.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'js/stage') diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index a624b2c6..e139af97 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js @@ -170,8 +170,7 @@ exports.Stage = Montage.create(Component, { // Hack for now until a full component this.layout.draw(); - } - else if(this.updatedStage) { + } else if(this.updatedStage) { this.layout.draw(); this.layout.draw3DInfo(true); } @@ -235,6 +234,10 @@ exports.Stage = Montage.create(Component, { this.hideCanvas(false); + // Recalculate the canvas sizes because of splitter resizing + this._canvas.width = this._layoutCanvas.width = this._drawingCanvas.width = this.element.offsetWidth - 11 ; + this._canvas.height = this._layoutCanvas.height = this._drawingCanvas.height = this.element.offsetHeight - 11; + this._documentRoot = this.application.ninja.currentDocument.documentRoot; this._viewport = this.application.ninja.currentDocument.documentRoot.parentNode; -- cgit v1.2.3