summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2015-10-19 18:16:28 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2015-10-19 18:16:28 +0200
commitc4c72526cff7f6c2dcd93156d73dd330bcb9e0e1 (patch)
tree1ebfcfd90f84d2089eb34dcd870b6a796687a621 /js
parent8fff7304d78ab79ca135cb16159912a43c7cb705 (diff)
downloadbugzilla-c4c72526cff7f6c2dcd93156d73dd330bcb9e0e1.tar.gz
bugzilla-c4c72526cff7f6c2dcd93156d73dd330bcb9e0e1.tar.xz
Bug 1210078: Going back from the "Match failed" page deletes the values of user fields
r=gerv
Diffstat (limited to 'js')
-rw-r--r--js/field.js2
-rw-r--r--js/global.js12
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');
+ });
+});