root / htmltest / sites / all / modules / i18n / i18n.js @ a5572547
1 | 85ad3d82 | Assos Assos | |
---|---|---|---|
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); |