diff options
author | Valerio Virgillito | 2012-03-14 18:04:11 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-03-14 18:04:11 -0700 |
commit | a7cb2c0b22f03b79f19d4a9a2eb691d1ccc392f9 (patch) | |
tree | 8daf6d201890c1fb7f8dbffe492500d492ae96d7 /js/stage | |
parent | e07ec7dd1a4b8df747f6af0d54fe95e3a237f0c8 (diff) | |
download | ninja-a7cb2c0b22f03b79f19d4a9a2eb691d1ccc392f9.tar.gz |
adding a focus manager to handle panel bugs where blur was not getting called when clicking on the canvas.
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/stage')
-rwxr-xr-x | js/stage/stage.reel/stage.html | 7 | ||||
-rwxr-xr-x | js/stage/stage.reel/stage.js | 4 |
2 files changed, 10 insertions, 1 deletions
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 @@ | |||
50 | "element" : {"#": "textToolObject"} | 50 | "element" : {"#": "textToolObject"} |
51 | } | 51 | } |
52 | }, | 52 | }, |
53 | |||
54 | "focusManager": { | ||
55 | "object": "js/components/focus-manager.reel" | ||
56 | }, | ||
53 | 57 | ||
54 | "owner": { | 58 | "owner": { |
55 | "module": "js/stage/stage.reel", | 59 | "module": "js/stage/stage.reel", |
@@ -63,7 +67,8 @@ | |||
63 | "stageDeps": {"@": "StageDeps1"}, | 67 | "stageDeps": {"@": "StageDeps1"}, |
64 | "layout": {"@": "layout1"}, | 68 | "layout": {"@": "layout1"}, |
65 | "stageView": {"@": "stageView"}, | 69 | "stageView": {"@": "stageView"}, |
66 | "textTool": {"@": "textTool"} | 70 | "textTool": {"@": "textTool"}, |
71 | "focusManager": {"@": "focusManager"} | ||
67 | }, | 72 | }, |
68 | "bindings": { | 73 | "bindings": { |
69 | "currentDocumentStageView": { | 74 | "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, { | |||
319 | 319 | ||
320 | handleMousedown: { | 320 | handleMousedown: { |
321 | value: function(event) { | 321 | value: function(event) { |
322 | // Call the focus manager to set focus to blur any focus'd elements | ||
323 | this.focusManager.setFocus(); | ||
324 | |||
325 | |||
322 | var point; | 326 | var point; |
323 | // event.preventDefault(); // commenting because HTML elements in the IDE are retaining focus | 327 | // event.preventDefault(); // commenting because HTML elements in the IDE are retaining focus |
324 | // If right click set the context menu to true to prevent a mouse up. | 328 | // If right click set the context menu to true to prevent a mouse up. |