Change the way canvases get temporarily focused when there is more than one and the mouse is outside all of them.

Closes #115.
This commit is contained in:
Jürg Lehni 2012-10-22 18:03:57 -07:00
parent 20797b8cc3
commit 7096b37b2e

View file

@ -474,6 +474,7 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{
/*#*/ if (options.browser) { /*#*/ if (options.browser) {
var tool, var tool,
curPoint, curPoint,
prevFocus,
tempFocus, tempFocus,
dragging = false; dragging = false;
@ -525,10 +526,11 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{
if (view) { if (view) {
// Temporarily focus this view without making it sticky, so // Temporarily focus this view without making it sticky, so
// Key events are handled too during the mouse over // Key events are handled too during the mouse over
prevFocus = View._focused;
View._focused = tempFocus = view; View._focused = tempFocus = view;
} else if (tempFocus && tempFocus == View._focused) { } else if (tempFocus && tempFocus == View._focused) {
// Clear temporary focus again and update it. // Clear temporary focus again and update it.
View._focused = null; View._focused = prevFocus;
updateFocus(); updateFocus();
} }
} }