Projet

Général

Profil

Paste
Télécharger (713 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / views / js / exposed-form-ajax.js @ 4003efde

1
/**
2
 * @file
3
 * Handles Views' exposed form AJAX data submission.
4
 */
5

    
6
(function ($) {
7
  'use strict';
8

    
9
  /**
10
   * Gets Form build info from settings and adds it to ajax data.
11
   *
12
   * @see views_exposed_form_ajax_enable().
13
   */
14
  Drupal.behaviors.ViewsExposedFormAjax = {
15
    attach: function (context, settings) {
16
      for (var ajaxObject in Drupal.ajax) {
17
        for (var name in Drupal.settings.ViewsExposedFormInfo) {
18
          if (Drupal.ajax[ajaxObject].options && Drupal.ajax[ajaxObject].options.data._triggering_element_name === name) {
19
            jQuery.extend(Drupal.ajax[ajaxObject].options.data, Drupal.settings.ViewsExposedFormInfo[name]);
20
          }
21
        }
22
      }
23
    }
24
  };
25

    
26
})(jQuery);