From 0da7127a7ad18f6dac71e2064140fccc7acc78bc Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 6 Oct 2015 22:06:40 +0800 Subject: Bug 1172418 - user fields are cleared when navigating back to a page (eg. after an error) --- js/global.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'js/global.js') 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'); + }); +}); -- cgit v1.2.3-24-g4f1b