mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
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:
parent
20797b8cc3
commit
7096b37b2e
1 changed files with 3 additions and 1 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue