Projet

Général

Profil

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

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

1
(function ($) {
2

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

    
20
})(jQuery);