Projet

Général

Profil

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

root / drupal7 / sites / all / modules / i18n / i18n.js @ 76df55b7

1

    
2
(function ($) {
3

    
4
/**
5
 * Rewrite autocomplete inputs to pass the language of the node currently being
6
 * edited in the path.
7
 *
8
 * This functionality ensures node autocompletes get suggestions for the node's
9
 * language rather than the current interface language.
10
 */
11
Drupal.behaviors.i18n = {
12
  attach: function (context) {
13
    if (Drupal.settings && Drupal.settings.i18n) {
14
      $('form[id^=node-form]', context).find('input.autocomplete[value^=' + Drupal.settings.i18n.interface_path + ']').each(function () {
15
        $(this).val($(this).val().replace(Drupal.settings.i18n.interface_path, Drupal.settings.i18n.content_path));
16
      });
17
    }
18
  }
19
};
20

    
21
})(jQuery);