Projet

Général

Profil

Révision 599a39cd

Ajouté par Assos Assos il y a environ 3 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/date/date_popup/date_popup.js
1 1
/**
2
 * Attaches the calendar behavior to all required fields
2
 * @file
3
 * Attaches the calendar behavior to all required fields.
3 4
 */
5

  
4 6
(function($) {
5 7
  function makeFocusHandler(e) {
6 8
    if (!$(this).hasClass('date-popup-init')) {
......
10 12
        case 'datepicker':
11 13
          $(this)
12 14
            .datepicker(datePopup.settings)
13
            .addClass('date-popup-init');
14
          $(this).click(function(){
15
            $(this).focus();
16
          });
15
            .addClass('date-popup-init')
16
            .focus();
17 17
          if (datePopup.settings.syncEndDate) {
18 18
            $('.start-date-wrapper').each(function(){
19 19
              var start_date_wrapper = this;
......
27 27
        case 'timeEntry':
28 28
          $(this)
29 29
            .timeEntry(datePopup.settings)
30
            .addClass('date-popup-init');
31
          $(this).click(function(){
32
            $(this).focus();
33
          });
30
            .addClass('date-popup-init')
31
            .focus();
34 32
          break;
35 33

  
36 34
        case 'timepicker':
......
54 52
          datePopup.settings.startTime = new Date(datePopup.settings.startTime);
55 53
          $(this)
56 54
            .timepicker(datePopup.settings)
57
            .addClass('date-popup-init');
58
          $(this).click(function(){
59
            $(this).focus();
60
          });
55
            .addClass('date-popup-init')
56
            .focus();
61 57
          break;
62 58
      }
63 59
    }
......
66 62
  Drupal.behaviors.date_popup = {
67 63
    attach: function (context) {
68 64
      for (var id in Drupal.settings.datePopup) {
69
        $('#'+ id).bind('focus', Drupal.settings.datePopup[id], makeFocusHandler);
65
        $('#' + id).bind('focus', Drupal.settings.datePopup[id], makeFocusHandler);
70 66
      }
71 67
    }
72 68
  };
69

  
73 70
})(jQuery);

Formats disponibles : Unified diff