[jQuery] @mike: blockUI fix

[jQuery] @mike: blockUI fix


Mike, i've seen that you implemented the tab question i asked for.
However, when testing it, i came to the conclusion that you could
still tab out of the element, but not back into it. As i can't access
SVN from work, i thought i'd post the fix here.
I've tested this on the "simple dialog" example of your site, but
adding this extra line:
jQuery.blockUI.defaults.allowTabToLeave = 0;
----------------------------------------------------------------------------------------------------
// event handler to suppress keyboard/mouse events when blocking
handler: function(e) {
    //->Gilles
    // Previous "allowTabToLeave" code did not work. You could tab
out, but not tab back in.
    // This code works different. If you want to tab, and you aren't
allowed to leave, it sets
    // the focus back on the element you are showing.
if (e.keyCode && e.keyCode == 9 && !
$.blockUI.defaults.allowTabToLeave) {
    if ($(e.target).parents('div.blockMsg').length > 0) {
        return true;
    } else {
        // For some reason, calling the "focus" function did not
work here.
         var v = $(':input:visible:enabled', $.blockUI.impl.pageBlock)
[0];
         if (v) v.focus();
         // Suppress old tabby key
        return false;
    }
}
    //<-Gilles
if ($(e.target).parents('div.blockMsg').length > 0)
return true;
return $
(e.target).parents().children().filter('div.blockUI').length == 0;
},
----------------------------------------------------------------------------------------------------