Skip to content

Commit 6e0792f

Browse files
committed
whitespace, triple equal, expression linting
1 parent 5baa88e commit 6e0792f

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

js/jquery.mobile.collapsible.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,11 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
9494
collapsible
9595
.bind( "expand collapse", function( event ) {
9696
if ( !event.isDefaultPrevented() ) {
97-
98-
event.preventDefault();
99-
10097
var $this = $( this ),
10198
isCollapse = ( event.type === "collapse" ),
102-
contentTheme = o.contentTheme;
99+
contentTheme = o.contentTheme;
100+
101+
event.preventDefault();
103102

104103
collapsibleHeading
105104
.toggleClass( "ui-collapsible-heading-collapsed", isCollapse)

js/jquery.mobile.forms.slider.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
3333

3434
cType = control[ 0 ].nodeName.toLowerCase(),
3535

36-
selectClass = ( cType == "select" ) ? "ui-slider-switch" : "",
36+
selectClass = ( cType === "select" ) ? "ui-slider-switch" : "",
3737

3838
controlID = control.attr( "id" ),
3939

@@ -44,16 +44,16 @@ $.widget( "mobile.slider", $.mobile.widget, {
4444
label = $label.attr( "id", labelID ),
4545

4646
val = function() {
47-
return cType == "input" ? parseFloat( control.val() ) : control[0].selectedIndex;
47+
return cType === "input" ? parseFloat( control.val() ) : control[0].selectedIndex;
4848
},
4949

50-
min = cType == "input" ? parseFloat( control.attr( "min" ) ) : 0,
50+
min = cType === "input" ? parseFloat( control.attr( "min" ) ) : 0,
5151

52-
max = cType == "input" ? parseFloat( control.attr( "max" ) ) : control.find( "option" ).length-1,
52+
max = cType === "input" ? parseFloat( control.attr( "max" ) ) : control.find( "option" ).length-1,
5353

5454
step = window.parseFloat( control.attr( "step" ) || 1 ),
5555

56-
inlineClass = ( this.options.inline || control.jqmData("inline") == true ) ? " ui-slider-inline" : "",
56+
inlineClass = ( this.options.inline || control.jqmData("inline") === true ) ? " ui-slider-inline" : "",
5757

5858
miniClass = ( this.options.mini || control.jqmData("mini") ) ? " ui-slider-mini" : "",
5959

@@ -63,7 +63,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
6363
domSlider = document.createElement('div'),
6464
slider = $( domSlider ),
6565

66-
valuebg = control.jqmData("highlight") && cType != "select" ? (function() {
66+
valuebg = control.jqmData("highlight") && cType !== "select" ? (function() {
6767
var bg = document.createElement('div');
6868
bg.className = 'ui-slider-bg ' + $.mobile.activeBtnClass + ' ui-btn-corner-all';
6969
return $( bg ).prependTo( slider );
@@ -98,7 +98,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
9898
mouseMoved: false
9999
});
100100

101-
if ( cType == "select" ) {
101+
if ( cType === "select" ) {
102102
var wrapper = document.createElement('div');
103103
wrapper.className = 'ui-slider-inneroffset';
104104

@@ -196,7 +196,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
196196

197197
// this is a drag, change the value only if user dragged enough
198198
if ( self.userModified ) {
199-
self.refresh( self.beforeStart == 0 ? 1 : 0 );
199+
self.refresh( self.beforeStart === 0 ? 1 : 0 );
200200
}
201201
else {
202202
self.refresh( self.beforeStart );
@@ -205,7 +205,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
205205
}
206206
else {
207207
// this is just a click, change the value
208-
self.refresh( self.beforeStart == 0 ? 1 : 0 );
208+
self.refresh( self.beforeStart === 0 ? 1 : 0 );
209209
}
210210

211211
}
@@ -219,7 +219,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
219219
slider.insertAfter( control );
220220

221221
// Only add focus class to toggle switch, sliders get it automatically from ui-btn
222-
if( cType == 'select' ) {
222+
if( cType === 'select' ) {
223223
this.handle.bind({
224224
focus: function() {
225225
slider.addClass( $.mobile.focusClass );
@@ -365,7 +365,10 @@ $.widget( "mobile.slider", $.mobile.widget, {
365365
"aria-valuetext": cType === "input" ? newval : control.find( "option" ).eq( newval ).getEncodedText(),
366366
title: cType === "input" ? newval : control.find( "option" ).eq( newval ).getEncodedText()
367367
});
368-
this.valuebg && this.valuebg.css( "width", percent + "%" );
368+
369+
if( this.valuebg ){
370+
this.valuebg.css( "width", percent + "%" );
371+
}
369372

370373
// drag the label widths
371374
if ( this._labels ) {

js/jquery.mobile.page.sections.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $.mobile.page.prototype.options.footerTheme = "a";
1515
$.mobile.page.prototype.options.contentTheme = null;
1616

1717
// NOTE bind used to force this binding to run before the buttonMarkup binding
18-
// which expects .ui-footer top be applied in its gigantic selector
18+
// which expects .ui-footer top be applied in its gigantic selector
1919
// TODO remove the buttonMarkup giant selector and move it to the various modules
2020
// on which it depends
2121
$( document ).bind( "pagecreate", function( e ) {
@@ -85,7 +85,7 @@ $( document ).bind( "pagecreate", function( e ) {
8585

8686
} else if ( role === "content" ) {
8787
if ( contentTheme ) {
88-
$this.addClass( "ui-body-" + ( contentTheme ) );
88+
$this.addClass( "ui-body-" + ( contentTheme ) );
8989
}
9090

9191
// Add ARIA role

0 commit comments

Comments
 (0)