Improve handling of previously focused view.

Make sure we switch back to the original one if there are multiple neighboring views.
This commit is contained in:
Jürg Lehni 2016-01-14 11:47:18 +01:00
parent cee3959bfa
commit 5f44d814f5

View file

@ -810,7 +810,8 @@ new function() { // Injection scope for mouse events on the browser
// view, to let items receive receive a mouseleave, etc.
if (view)
handleMouseMove(view, event);
prevFocus = view;
if (!prevFocus)
prevFocus = view;
view = View._focused = tempFocus = target;
}
} else if (tempFocus && tempFocus === view) {
@ -819,6 +820,7 @@ new function() { // Injection scope for mouse events on the browser
if (prevFocus && !prevFocus.isInserted())
prevFocus = null;
view = View._focused = prevFocus;
prevFocus = null;
updateFocus();
}
}