Skip to content

Commit 34b7fd0

Browse files
committed
squash: code cleanup
1 parent 014960c commit 34b7fd0

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

ui/jquery.ui.button.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
(function( $, undefined ) {
1616

1717
var baseClasses = "ui-button ui-widget ui-corner-all",
18-
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",
18+
typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons" +
19+
" ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only" +
20+
" ui-icon-begining ui-icon-end ui-icon-top ui-icon-bottom",
1921
formResetHandler = function() {
2022
var form = $( this );
2123
setTimeout(function() {
@@ -99,8 +101,9 @@ $.widget( "ui.button", {
99101
}
100102

101103
if ( this.element.is("a") ) {
102-
this.element.keyup(function(event) {
104+
this.element.keyup( function( event ) {
103105
if ( event.keyCode === $.ui.keyCode.SPACE ) {
106+
104107
// TODO pass through original event correctly (just as 2nd argument doesn't work)
105108
$( this ).click();
106109
}
@@ -121,7 +124,8 @@ $.widget( "ui.button", {
121124

122125
_destroy: function() {
123126
this.element
124-
.removeClass( "ui-helper-hidden-accessible " + baseClasses + " ui-state-active " + typeClasses )
127+
.removeClass( "ui-helper-hidden-accessible " + baseClasses +
128+
" ui-state-active " + typeClasses )
125129
.removeAttr( "role" )
126130
.removeAttr( "aria-pressed" );
127131

@@ -160,6 +164,7 @@ $.widget( "ui.button", {
160164
},
161165

162166
refresh: function() {
167+
163168
//See #8237 & #8828
164169
var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
165170

ui/jquery.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)