summaryrefslogtreecommitdiffstats
path: root/js/global.js
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-10-06 16:06:40 +0200
committerByron Jones <glob@mozilla.com>2015-10-06 16:06:40 +0200
commit0da7127a7ad18f6dac71e2064140fccc7acc78bc (patch)
tree07f58f37e608f38f09e8f75fb7ac290c3f901476 /js/global.js
parent8ab60b2f6c2cb9374435eb99ee7a06ef9bce0329 (diff)
downloadbugzilla-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.js13
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');
+ });
+});