diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/field.js | 2 | ||||
-rw-r--r-- | js/global.js | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/js/field.js b/js/field.js index 2bd8868f8..063d48c47 100644 --- a/js/field.js +++ b/js/field.js @@ -794,6 +794,7 @@ $(function() { else { that.devbridgeAutocomplete(options_user); } + that.addClass('bz_autocomplete'); }); // init autocomplete fields with array of values @@ -809,6 +810,7 @@ $(function() { this.focus(); } }); + that.addClass('bz_autocomplete'); }); }); diff --git a/js/global.js b/js/global.js index b4905e202..dcffc3529 100644 --- a/js/global.js +++ b/js/global.js @@ -51,3 +51,15 @@ function display_value(field, value) { if (translated) return translated; return value; } + +// jQuery auto-completion disables browser native autocompletion, however this +// excludes it from being restored by bfcache. Trick the browser into restoring +// it by changing the autocomplete attribute when a page is hidden and shown. +$().ready(function() { + $(window).on('pagehide', function() { + $('.bz_autocomplete').attr('autocomplete', 'on'); + }); + $(window).on('pageshow', function() { + $('.bz_autocomplete').attr('autocomplete', 'off'); + }); +}); |