]> source.dussan.org Git - jquery-ui.git/commitdiff
Button: Refactored formResetHandler and fixed scope. Foxes #7261 - Refresh scope...
authorScott González <scott.gonzalez@gmail.com>
Wed, 18 May 2011 14:32:59 +0000 (10:32 -0400)
committerScott González <scott.gonzalez@gmail.com>
Wed, 18 May 2011 14:33:37 +0000 (10:33 -0400)
(cherry picked from commit e0fafbb73526f60fdeab3f75532d6a4059d0d82a)

ui/jquery.ui.button.js

index 2539846f6f5104c494a49c44a81a9355ae54380f..1bc016edd8726735895d0184feee9a471f857717 100644 (file)
@@ -17,13 +17,11 @@ var lastActive, startXPos, startYPos, clickDragged,
        baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
        stateClasses = "ui-state-hover ui-state-active ",
        typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
-       formResetHandler = function( event ) {
-               $( ":ui-button", event.target.form ).each(function() {
-                       var inst = $( this ).data( "button" );
-                       setTimeout(function() {
-                               inst.refresh();
-                       }, 1 );
-               });
+       formResetHandler = function() {
+               var buttons = $( this ).find( ":ui-button" );
+               setTimeout(function() {
+                       buttons.button( "refresh" );
+               }, 1 );
        },
        radioGroup = function( radio ) {
                var name = radio.name,