]> source.dussan.org Git - jquery-ui.git/commitdiff
Spinner: Don't stop propgation of mousedown. Added TODOs.
authorScott González <scott.gonzalez@gmail.com>
Sat, 6 Aug 2011 17:27:42 +0000 (13:27 -0400)
committerScott González <scott.gonzalez@gmail.com>
Sat, 6 Aug 2011 17:27:42 +0000 (13:27 -0400)
ui/jquery.ui.spinner.js

index 1b55d83743ceb74b1a2653390112a132dfd243bc..a8f3a4fe980d2b96f815f1acc5e33c1fcdc99235 100644 (file)
@@ -103,14 +103,15 @@ $.widget( "ui.spinner", {
                this._bind( this.buttons, {
                        mousedown: function( event ) {
                                if ( this._start( event ) === false ) {
-                                       // TODO: do we really want to stop propagation?
-                                       return false;
+                                       return;
                                }
+
                                this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
                        },
                        mouseup: function( event ) {
                                if ( this.spinning ) {
                                        this._stop( event );
+                                       // TODO: don't trigger change until the field is blurred
                                        this._change( event );
                                }
                        },
@@ -125,7 +126,9 @@ $.widget( "ui.spinner", {
                                }
                                this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
                        },
-                       // TODO: we shouldn't trigger any events until mouseup
+                       // 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() {
                                if ( this.spinning ) {
                                        this._stop( event );
@@ -183,6 +186,7 @@ $.widget( "ui.spinner", {
                                this.timeout = setTimeout(function() {
                                        if ( this.spinning ) {
                                                this._stop( event );
+                                               // TODO: don't trigger change until the field is blurred
                                                this._change( event );
                                        }
                                }, 100 );