Prevent FF and Chrome from clearing input value
parent
7df7eca61b
commit
7b47d7a939
|
@ -138,6 +138,8 @@ SimpleAutocomplete.prototype.init = function()
|
||||||
this.addRmListener('change', function() { return self.onChange(); });
|
this.addRmListener('change', function() { return self.onChange(); });
|
||||||
this.addRmListener('focus', function() { return self.onInputFocus(); });
|
this.addRmListener('focus', function() { return self.onInputFocus(); });
|
||||||
this.addRmListener('blur', function() { return self.onInputBlur(); });
|
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); });
|
addListener(t, 'mousedown', function(ev) { return self.cancelBubbleOnHint(ev); });
|
||||||
this.onChange();
|
this.onChange();
|
||||||
};
|
};
|
||||||
|
@ -193,6 +195,8 @@ SimpleAutocomplete.prototype.remove = function()
|
||||||
if (!this.hintLayer)
|
if (!this.hintLayer)
|
||||||
return;
|
return;
|
||||||
this.hintLayer.parentNode.removeChild(this.hintLayer);
|
this.hintLayer.parentNode.removeChild(this.hintLayer);
|
||||||
|
removeListener(window, 'beforeunload', this.closure['beforeunload']);
|
||||||
|
delete this.closure['beforeunload'];
|
||||||
for (var i in this.closure)
|
for (var i in this.closure)
|
||||||
{
|
{
|
||||||
removeListener(this.input, i, this.closure[i]);
|
removeListener(this.input, i, this.closure[i]);
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue