Prevent FF and Chrome from clearing input value

master
Vitaliy Filippov 2013-04-08 23:34:24 +00:00
parent 7df7eca61b
commit 7b47d7a939
2 changed files with 5 additions and 1 deletions

View File

@ -138,6 +138,8 @@ SimpleAutocomplete.prototype.init = function()
this.addRmListener('change', function() { return self.onChange(); });
this.addRmListener('focus', function() { return self.onInputFocus(); });
this.addRmListener('blur', function() { return self.onInputBlur(); });
// Set autocomplete=on to prevent FF and Chrome from clearing inputs on Back click
addListener(window, 'beforeunload', this.closure['beforeunload'] = function() { e.autocomplete = 'on'; });
addListener(t, 'mousedown', function(ev) { return self.cancelBubbleOnHint(ev); });
this.onChange();
};
@ -193,6 +195,8 @@ SimpleAutocomplete.prototype.remove = function()
if (!this.hintLayer)
return;
this.hintLayer.parentNode.removeChild(this.hintLayer);
removeListener(window, 'beforeunload', this.closure['beforeunload']);
delete this.closure['beforeunload'];
for (var i in this.closure)
{
removeListener(this.input, i, this.closure[i]);

2
hinter.min.js vendored

File diff suppressed because one or more lines are too long