Skip to content

Commit c45dd91

Browse files
committed
Button: Refactored formResetHandler and fixed scope. Foxes #7261 - Refresh scope in formResetHandler unintentionally wide.
(cherry picked from commit e0fafbb)
1 parent 3124864 commit c45dd91

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

ui/jquery.ui.button.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ var lastActive, startXPos, startYPos, clickDragged,
1717
baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
1818
stateClasses = "ui-state-hover ui-state-active ",
1919
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",
20-
formResetHandler = function( event ) {
21-
$( ":ui-button", event.target.form ).each(function() {
22-
var inst = $( this ).data( "button" );
23-
setTimeout(function() {
24-
inst.refresh();
25-
}, 1 );
26-
});
20+
formResetHandler = function() {
21+
var buttons = $( this ).find( ":ui-button" );
22+
setTimeout(function() {
23+
buttons.button( "refresh" );
24+
}, 1 );
2725
},
2826
radioGroup = function( radio ) {
2927
var name = radio.name,

0 commit comments

Comments
 (0)