Currently, when you TAB into a date field, the date picker doesn't
open.  It only opens if you click on the field.

I added eventName:'focus' to the date & datetime setup calls in
web2py_ajax.js, and a hide() call for their blur events:

  try {jQuery("input.date").live('focus',function() {Calendar.setup({
      inputField:this, ifFormat:date_format, showsTime:false,
eventName:'focus'
  }); }); } catch(e) {};
...
  try { jQuery("input.datetime").live('focus', function()
{Calendar.setup({
      inputField:this, ifFormat:datetime_format, showsTime:
true,timeFormat: "24", eventName:'focus'
  }); }); } catch(e) {};
  jQuery("input.date,input.datetime").live('blur', function()
{ window.calendar.hide(); });

I also didn't like the fact that if you have the calendar open, you
have to click another field twice to shift focus out of the calendar
(first click closes the calendar, second click focuses on the target).

So I included the following in web2py_ajax.js to prevent the
"stopEvent" call - though it could really be a patch to calendar.js:

// and prevent the stopevent, so you don't have to click twice to
focus on a different object
Calendar._checkCalendar = function(ev) {
        var calendar = window._dynarch_popupCalendar;
        if (!calendar) {
                return false;
        }
        var el = Calendar.is_ie ? Calendar.getElement(ev) :
Calendar.getTargetElement(ev);
        for (; el != null && el != calendar.element; el = el.parentNode);
        if (el == null) {
                // calls closeHandler which should hide the calendar.
                window._dynarch_popupCalendar.callCloseHandler();
                return /*Calendar.stopEvent(ev);*/
        }
};

kb

Reply via email to