[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/date/date_popup/ -> date_popup.js (source)

   1  
   2  /**
   3   * Attaches the calendar behavior to all required fields
   4   */
   5  Drupal.behaviors.date_popup = function (context) {
   6    for (var id in Drupal.settings.datePopup) {
   7      $('#'+ id).bind('focus', Drupal.settings.datePopup[id], function(e) {
   8        if (!$(this).hasClass('date-popup-init')) {
   9          var datePopup = e.data;
  10          // Explicitely filter the methods we accept.
  11          switch (datePopup.func) {
  12            case 'datepicker':
  13              $(this)
  14                .datepicker(datePopup.settings)
  15                .addClass('date-popup-init')
  16              $(this).click(function(){
  17                $(this).focus();
  18              });
  19              break;
  20  
  21            case 'timeEntry':
  22              $(this)
  23                .timeEntry(datePopup.settings)
  24                .addClass('date-popup-init')
  25              $(this).click(function(){
  26                $(this).focus();
  27              });
  28              break;
  29          }
  30        }
  31      });
  32    }
  33  };


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7