Skip to content

Commit b782bfc

Browse files
committed
squash: code cleanup
1 parent 6591ad1 commit b782bfc

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

ui/button.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
}(function( $ ) {
2626

2727
var baseClasses = "ui-button ui-widget ui-corner-all",
28-
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 ui-icon-begining ui-icon-end ui-icon-top ui-icon-bottom",
28+
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",
2931
formResetHandler = function() {
3032
var form = $( this );
3133
setTimeout(function() {
@@ -109,8 +111,9 @@ $.widget( "ui.button", {
109111
}
110112

111113
if ( this.element.is("a") ) {
112-
this.element.keyup(function(event) {
114+
this.element.keyup( function( event ) {
113115
if ( event.keyCode === $.ui.keyCode.SPACE ) {
116+
114117
// TODO pass through original event correctly (just as 2nd argument doesn't work)
115118
$( this ).click();
116119
}
@@ -131,7 +134,8 @@ $.widget( "ui.button", {
131134

132135
_destroy: function() {
133136
this.element
134-
.removeClass( "ui-helper-hidden-accessible " + baseClasses + " ui-state-active " + typeClasses )
137+
.removeClass( "ui-helper-hidden-accessible " + baseClasses +
138+
" ui-state-active " + typeClasses )
135139
.removeAttr( "role" )
136140
.removeAttr( "aria-pressed" );
137141

@@ -170,6 +174,7 @@ $.widget( "ui.button", {
170174
},
171175

172176
refresh: function() {
177+
173178
//See #8237 & #8828
174179
var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
175180

ui/checkboxradio.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ $.widget( "ui.checkboxradio", {
4848
icon: null
4949
},
5050

51-
_getCreateOptions: function () {
51+
_getCreateOptions: function() {
5252
var label,
5353
isDisabled = this.element.prop( "disabled" ),
5454
options = {};
@@ -130,7 +130,7 @@ $.widget( "ui.checkboxradio", {
130130
this.label = $( this.element[ 0 ].labels );
131131
} else {
132132

133-
// we don't search against the document in case the element
133+
// We don't search against the document in case the element
134134
// is disconnected from the DOM
135135
ancestor = this.element.parents().last();
136136
labelSelector = "label[for='" + this.element.attr("id") + "']";
@@ -172,8 +172,9 @@ $.widget( "ui.checkboxradio", {
172172
},
173173

174174
_destroy: function() {
175-
this.label.removeClass( "ui-button ui-corner-all ui-icon ui-icon-background ui-state-focus ui-icon-check " +
176-
"ui-icon-blank ui-radio-label ui-checkboxlabel ui-radio-checked ui-checkbox-checked" );
175+
this.label.removeClass( "ui-button ui-corner-all ui-icon ui-icon-background" +
176+
" ui-state-focus ui-icon-check ui-icon-blank ui-radio-label ui-checkboxlabel" +
177+
" ui-radio-checked ui-checkbox-checked" );
177178
this.element.removeClass( "ui-helper-hidden-accessible" );
178179
},
179180

@@ -212,13 +213,14 @@ $.widget( "ui.checkboxradio", {
212213
this.label.removeClass( "ui-state-active ui-" + this.type + "-checked" );
213214
}
214215
if ( this.options.label !== null ) {
215-
this.label.contents().not( this.label.children() )[0].nodeValue = this.options.label;
216+
this.label.contents().not( this.label.children() )[ 0 ].nodeValue = this.options.label;
216217
}
217218
},
218219

219220
refresh: function() {
220221

221222
this._setClasses();
223+
222224
//See #8237 & #8828
223225
var isDisabled = this.element.hasClass( "ui-checkboxradio-disabled" );
224226

0 commit comments

Comments
 (0)