]> source.dussan.org Git - jquery-ui.git/commitdiff
Spinner: Don't set focus on stop, focus should already be correct. Always remove...
authorScott González <scott.gonzalez@gmail.com>
Sat, 6 Aug 2011 19:26:12 +0000 (15:26 -0400)
committerScott González <scott.gonzalez@gmail.com>
Sat, 6 Aug 2011 19:26:12 +0000 (15:26 -0400)
ui/jquery.ui.spinner.js

index 2add2d60aec139a95099a6e2acdc10efa7ed3e17..da140308e8a80c2a1d278f392fede7de27ffc4da 100644 (file)
@@ -89,13 +89,7 @@ $.widget( "ui.spinner", {
                                if ( parsed === null ) {
                                        this.element.val( value );
                                }
-                               // TODO: is this really correct or just the simplest
-                               // way to keep the active class when pressing the buttons?
-                               // if the mosue is over the text field and the user tabs out
-                               // shouldn't the active class get removed?
-                               if ( !uiSpinner.hasClass( "ui-state-hover" ) ) {
-                                       uiSpinner.removeClass( "ui-state-active" );
-                               }
+                               uiSpinner.removeClass( "ui-state-active" );
                        }
                });
 
@@ -139,7 +133,7 @@ $.widget( "ui.spinner", {
                        // TODO: do we really want to consider this a stop?
                        // shouldn't we just stop the repeater and wait until mouseup before
                        // we trigger the stop event?
-                       mouseleave: function() {
+                       mouseleave: function( event ) {
                                if ( this.spinning ) {
                                        this._stop( event );
                                        this._change( event );
@@ -284,7 +278,6 @@ $.widget( "ui.spinner", {
        _stop: function( event ) {
                clearTimeout( this.timer );
                this.counter = 0;
-               this.element.focus();
                this.spinning = false;
                this._trigger( "stop", event );
        },