From 7096b37b2e42c9020b9454ebd771fba1b04f2391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 22 Oct 2012 18:03:57 -0700 Subject: [PATCH] Change the way canvases get temporarily focused when there is more than one and the mouse is outside all of them. Closes #115. --- src/ui/View.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ui/View.js b/src/ui/View.js index f53566ba..7d979887 100644 --- a/src/ui/View.js +++ b/src/ui/View.js @@ -474,6 +474,7 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{ /*#*/ if (options.browser) { var tool, curPoint, + prevFocus, tempFocus, dragging = false; @@ -525,10 +526,11 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{ if (view) { // Temporarily focus this view without making it sticky, so // Key events are handled too during the mouse over + prevFocus = View._focused; View._focused = tempFocus = view; } else if (tempFocus && tempFocus == View._focused) { // Clear temporary focus again and update it. - View._focused = null; + View._focused = prevFocus; updateFocus(); } }