diff options
author | Byron Jones <glob@mozilla.com> | 2015-10-06 16:06:40 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2015-10-06 16:06:40 +0200 |
commit | 0da7127a7ad18f6dac71e2064140fccc7acc78bc (patch) | |
tree | 07f58f37e608f38f09e8f75fb7ac290c3f901476 /js/global.js | |
parent | 8ab60b2f6c2cb9374435eb99ee7a06ef9bce0329 (diff) | |
download | bugzilla-0da7127a7ad18f6dac71e2064140fccc7acc78bc.tar.gz bugzilla-0da7127a7ad18f6dac71e2064140fccc7acc78bc.tar.xz |
Bug 1172418 - user fields are cleared when navigating back to a page (eg. after an error)
Diffstat (limited to 'js/global.js')
-rw-r--r-- | js/global.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/global.js b/js/global.js index 7ecd3d901..896860d60 100644 --- a/js/global.js +++ b/js/global.js @@ -110,3 +110,16 @@ if (!String.prototype.htmlEncode) { }; })(); } + +// our auto-completion disables browser native autocompletion, however this +// excludes it from being restored by bf-cache. trick the browser into +// restoring 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(event) { + $('.bz_autocomplete').attr('autocomplete', 'off'); + }); +}); |