aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.spinner.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-10-17 10:12:35 -0400
committerScott González <scott.gonzalez@gmail.com>2011-10-17 10:12:35 -0400
commitbdd602e21bde0fee9879cc3b5d708c1ab86fb3fc (patch)
treeaaace041a673c30dd8cf933f660100a0f8e24821 /ui/jquery.ui.spinner.js
parent81b2ef4a6088cb99863c2d318947355a58019362 (diff)
downloadjquery-ui-bdd602e21bde0fee9879cc3b5d708c1ab86fb3fc.tar.gz
jquery-ui-bdd602e21bde0fee9879cc3b5d708c1ab86fb3fc.zip
Spinner: Re-enable autocomplete if the page is unloaded so the browser will remember the current value when navigating through history.
Diffstat (limited to 'ui/jquery.ui.spinner.js')
-rw-r--r--ui/jquery.ui.spinner.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js
index be2aaa246..7fc291c00 100644
--- a/ui/jquery.ui.spinner.js
+++ b/ui/jquery.ui.spinner.js
@@ -49,6 +49,15 @@ $.widget( "ui.spinner", {
this._draw();
this._bind( this._events );
this._refresh();
+
+ // turning off autocomplete prevents the browser from remembering the
+ // value when navigating through history, so we re-enable autocomplete
+ // if the page is unloaded before the widget is destroyed. #7790
+ this._bind( this.element[0].ownerDocument.defaultView, {
+ beforeunload: function() {
+ this.element.removeAttr( "autocomplete" );
+ }
+ });
},
_getCreateOptions: function() {