Skip to content

Commit 3223c29

Browse files
committed
Button: fixing missed instances of text option switching to showLabel
1 parent 19c6b9e commit 3223c29

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

tests/unit/button/button_common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
TestHelpers.commonWidgetTests( "button", {
22
defaults: {
33
disabled: null,
4-
text: true,
4+
showLabel: true,
55
label: null,
66
icon: null,
77
iconPosition: "begining",

tests/unit/button/button_options.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ test("disabled, null", function() {
4141
test("text false without icon", function() {
4242
expect( 1 );
4343
$("#button").button({
44-
text: false
44+
showLabel: false
4545
});
4646
ok( $("#button").is(":not(.ui-button-icon-only)") );
4747

@@ -51,7 +51,7 @@ test("text false without icon", function() {
5151
test("text false with icon", function() {
5252
expect( 1 );
5353
$("#button").button({
54-
text: false,
54+
showLabel: false,
5555
icon: "iconclass"
5656
});
5757
ok( $("#button").is(".ui-button-icon-only:not(.ui-button-text):has(span.ui-icon.iconclass)") );
@@ -97,7 +97,7 @@ test("label with input type submit", function() {
9797
test("icons", function() {
9898
expect( 1 );
9999
$("#button").button({
100-
text: false,
100+
showLabel: false,
101101
icon: "iconclass"
102102
});
103103
ok( $("#button").is(":has(span.ui-icon.iconclass)") );

ui/button.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
var baseClasses = "ui-button ui-widget ui-corner-all",
2828
typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons" +
29-
" ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only" +
30-
" ui-icon-begining ui-icon-end ui-icon-top ui-icon-bottom",
29+
"ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only" +
30+
"ui-icon-begining ui-icon-end ui-icon-top ui-icon-bottom",
3131
formResetHandler = function() {
3232
var form = $( this );
3333
setTimeout(function() {
@@ -111,9 +111,8 @@ $.widget( "ui.button", {
111111
}
112112

113113
if ( this.element.is("a") ) {
114-
this.element.keyup( function( event ) {
114+
this.element.keyup(function(event) {
115115
if ( event.keyCode === $.ui.keyCode.SPACE ) {
116-
117116
// TODO pass through original event correctly (just as 2nd argument doesn't work)
118117
$( this ).click();
119118
}
@@ -149,7 +148,7 @@ $.widget( "ui.button", {
149148
this.icon.addClass( " ui-icon " + value )
150149
.removeClass( this.options.icon );
151150
}
152-
if( key === "text" ) {
151+
if( key === "showLabel" ) {
153152
this.element.toggleClass( ".ui-button-icon-only", !( !!value ) )
154153
.toggleClass( this.options.iconPosition, !!value );
155154
this._setTitle();
@@ -174,9 +173,9 @@ $.widget( "ui.button", {
174173
},
175174

176175
refresh: function() {
177-
178176
//See #8237 & #8828
179-
var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
177+
var isDisabled = this.element.is( "input, button" ) ?
178+
this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
180179

181180
if ( isDisabled !== this.options.disabled ) {
182181
this._setOptions( { "disabled": isDisabled } );

0 commit comments

Comments
 (0)