diff options
Diffstat (limited to 'js/global.js')
-rw-r--r-- | js/global.js | 12 |
1 files changed, 12 insertions, 0 deletions
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'); + }); +}); |