Commit c4c72526 authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 1210078: Going back from the "Match failed" page deletes the values of user fields

r=gerv
parent 8fff7304
...@@ -794,6 +794,7 @@ $(function() { ...@@ -794,6 +794,7 @@ $(function() {
else { else {
that.devbridgeAutocomplete(options_user); that.devbridgeAutocomplete(options_user);
} }
that.addClass('bz_autocomplete');
}); });
// init autocomplete fields with array of values // init autocomplete fields with array of values
...@@ -809,6 +810,7 @@ $(function() { ...@@ -809,6 +810,7 @@ $(function() {
this.focus(); this.focus();
} }
}); });
that.addClass('bz_autocomplete');
}); });
}); });
......
...@@ -51,3 +51,15 @@ function display_value(field, value) { ...@@ -51,3 +51,15 @@ function display_value(field, value) {
if (translated) return translated; if (translated) return translated;
return value; 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');
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment