fix for bug where calling blur with empty focus stack would push an undefined element onto the stack

This commit is contained in:
rlx 2011-01-04 02:37:33 +00:00
parent dcbfbe7e49
commit 79dd2abfa7

View file

@ -411,7 +411,7 @@ requires
blur: function(id) { blur: function(id) {
Ox.print('BLUR', id, stack) Ox.print('BLUR', id, stack)
var index = stack.indexOf(id); var index = stack.indexOf(id);
if (index == stack.length - 1) { if (index > -1 && index == stack.length - 1) {
stack.length == 1 ? stack.pop() : stack.length == 1 ? stack.pop() :
stack.splice(stack.length - 2, 0, stack.pop()); stack.splice(stack.length - 2, 0, stack.pop());
// fix later: Ox.Event.unbindKeyboard($elements[id].options('id')); // fix later: Ox.Event.unbindKeyboard($elements[id].options('id'));