Skip to content
This repository
Browse code

Coding standards: liberal spacing, functions go snug to front if it's…

… the only argument.
  • Loading branch information...
commit 14d8c07ce4143b87ad4ab1849efed9fcac303a68 1 parent b44271e
Jasper de Groot jaspermdegroot authored
10 js/widgets/collapsible.js
@@ -26,8 +26,8 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
26 26 o = this.options,
27 27 collapsible = $el.addClass( "ui-collapsible" ),
28 28 collapsibleHeading = $el.children( o.heading ).first(),
29   - collapsedIcon = $el.jqmData("collapsed-icon") || o.collapsedIcon,
30   - expandedIcon = $el.jqmData("expanded-icon") || o.expandedIcon,
  29 + collapsedIcon = $el.jqmData( "collapsed-icon" ) || o.collapsedIcon,
  30 + expandedIcon = $el.jqmData( "expanded-icon" ) || o.expandedIcon,
31 31 collapsibleContent = collapsible.wrapInner( "<div class='ui-collapsible-content'></div>" ).children( ".ui-collapsible-content" ),
32 32 collapsibleSet = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" );
33 33
@@ -41,7 +41,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
41 41 if ( collapsibleSet.length ) {
42 42 // Inherit the theme from collapsible-set
43 43 if ( !o.theme ) {
44   - o.theme = collapsibleSet.jqmData("theme") || $.mobile.getInheritedTheme( collapsibleSet, "c" );
  44 + o.theme = collapsibleSet.jqmData( "theme" ) || $.mobile.getInheritedTheme( collapsibleSet, "c" );
45 45 }
46 46 // Inherit the content-theme from collapsible-set
47 47 if ( !o.contentTheme ) {
@@ -61,7 +61,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
61 61 o.iconPos = collapsibleSet.jqmData( "iconpos" );
62 62 }
63 63
64   - if( !o.mini ) {
  64 + if ( !o.mini ) {
65 65 o.mini = collapsibleSet.jqmData( "mini" );
66 66 }
67 67 }
@@ -143,7 +143,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
143 143 });
144 144
145 145 //auto self-init widgets
146   -$( document ).bind( "pagecreate create", function( e ){
  146 +$( document ).bind( "pagecreate create", function( e ) {
147 147 $.mobile.collapsible.prototype.enhanceWithin( e.target );
148 148 });
149 149
6 js/widgets/collapsibleSet.js
@@ -50,7 +50,7 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, {
50 50 .bind( "expand", function( event ) {
51 51 var closestCollapsible = $( event.target )
52 52 .closest( ".ui-collapsible" );
53   - if( closestCollapsible.parent().is( ":jqmData(role='collapsible-set')" ) ) {
  53 + if ( closestCollapsible.parent().is( ":jqmData(role='collapsible-set')" ) ) {
54 54 closestCollapsible
55 55 .siblings( ".ui-collapsible" )
56 56 .trigger( "collapse" );
@@ -78,7 +78,7 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, {
78 78 $.mobile.collapsible.prototype.enhance( collapsiblesInSet.not( ".ui-collapsible" ) );
79 79
80 80 // clean up borders
81   - collapsiblesInSet.each( function() {
  81 + collapsiblesInSet.each(function() {
82 82 $( this ).jqmRemoveData( "collapsible-last" )
83 83 .find( $.mobile.collapsible.prototype.options.heading )
84 84 .find( "a" ).first()
@@ -105,7 +105,7 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, {
105 105 });
106 106
107 107 //auto self-init widgets
108   -$( document ).bind( "pagecreate create", function( e ){
  108 +$( document ).bind( "pagecreate create", function( e ) {
109 109 $.mobile.collapsibleset.prototype.enhanceWithin( e.target );
110 110 });
111 111
8 js/widgets/dialog.js
@@ -19,7 +19,7 @@ $.widget( "mobile.dialog", $.mobile.widget, {
19 19 var self = this,
20 20 $el = this.element,
21 21 headerCloseButton = $( "<a href='#' data-" + $.mobile.ns + "icon='delete' data-" + $.mobile.ns + "iconpos='notext'>"+ this.options.closeBtnText + "</a>" ),
22   - dialogWrap = $("<div/>", {
  22 + dialogWrap = $( "<div/>", {
23 23 "role" : "dialog",
24 24 "class" : "ui-dialog-contain ui-corner-all ui-overlay-shadow"
25 25 });
@@ -72,8 +72,8 @@ $.widget( "mobile.dialog", $.mobile.widget, {
72 72 $( this ).find( "." + $.mobile.activeBtnClass ).not( ".ui-slider-bg" ).removeClass( $.mobile.activeBtnClass );
73 73 })
74 74 // Override the theme set by the page plugin on pageshow
75   - .bind( "pagebeforeshow", function(){
76   - if( self.options.overlayTheme ){
  75 + .bind( "pagebeforeshow", function() {
  76 + if ( self.options.overlayTheme ) {
77 77 self.element
78 78 .page( "removeContainerBackground" )
79 79 .page( "setContainerBackground", self.options.overlayTheme );
@@ -103,7 +103,7 @@ $.widget( "mobile.dialog", $.mobile.widget, {
103 103 });
104 104
105 105 //auto self-init widgets
106   -$( document ).delegate( $.mobile.dialog.prototype.options.initSelector, "pagecreate", function(){
  106 +$( document ).delegate( $.mobile.dialog.prototype.options.initSelector, "pagecreate", function() {
107 107 $.mobile.dialog.prototype.enhance( this );
108 108 });
109 109
78 js/widgets/fixedToolbar.js
@@ -28,7 +28,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
28 28 // Testing fixed positioning is also pretty obtrusive to page load, requiring injected elements and scrolling the window
29 29 // The following function serves to rule out some popular browsers with known fixed-positioning issues
30 30 // This is a plugin option like any other, so feel free to improve or overwrite it
31   - supportBlacklist: function(){
  31 + supportBlacklist: function() {
32 32 var w = window,
33 33 ua = navigator.userAgent,
34 34 platform = navigator.platform,
@@ -53,7 +53,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
53 53 // WebOS less than 3
54 54 ( "palmGetResource" in window && wkversion && wkversion < 534 ) ||
55 55 // MeeGo
56   - ( ua.indexOf( "MeeGo" ) > -1 && ua.indexOf( "NokiaBrowser/8.5.0" ) > -1 ) ){
  56 + ( ua.indexOf( "MeeGo" ) > -1 && ua.indexOf( "NokiaBrowser/8.5.0" ) > -1 ) ) {
57 57 return true;
58 58 }
59 59
@@ -68,10 +68,10 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
68 68 o = self.options,
69 69 $el = self.element,
70 70 tbtype = $el.is( ":jqmData(role='header')" ) ? "header" : "footer",
71   - $page = $el.closest(".ui-page");
  71 + $page = $el.closest( ".ui-page" );
72 72
73 73 // Feature detecting support for
74   - if( o.supportBlacklist() ){
  74 + if ( o.supportBlacklist() ) {
75 75 self.destroy();
76 76 return;
77 77 }
@@ -79,7 +79,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
79 79 $el.addClass( "ui-"+ tbtype +"-fixed" );
80 80
81 81 // "fullscreen" overlay positioning
82   - if( o.fullscreen ){
  82 + if ( o.fullscreen ) {
83 83 $el.addClass( "ui-"+ tbtype +"-fullscreen" );
84 84 $page.addClass( "ui-page-" + tbtype + "-fullscreen" );
85 85 }
@@ -93,12 +93,12 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
93 93 self._bindToggleHandlers();
94 94 },
95 95
96   - _addTransitionClass: function(){
  96 + _addTransitionClass: function() {
97 97 var tclass = this.options.transition;
98 98
99   - if( tclass && tclass !== "none" ){
  99 + if ( tclass && tclass !== "none" ) {
100 100 // use appropriate slide for header or footer
101   - if( tclass === "slide" ){
  101 + if ( tclass === "slide" ) {
102 102 tclass = this.element.is( ".ui-header" ) ? "slidedown" : "slideup";
103 103 }
104 104
@@ -106,7 +106,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
106 106 }
107 107 },
108 108
109   - _bindPageEvents: function(){
  109 + _bindPageEvents: function() {
110 110 var self = this,
111 111 o = self.options,
112 112 $el = self.element;
@@ -115,38 +115,38 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
115 115 // Fixed toolbars require page zoom to be disabled, otherwise usability issues crop up
116 116 // This method is meant to disable zoom while a fixed-positioned toolbar page is visible
117 117 $el.closest( ".ui-page" )
118   - .bind( "pagebeforeshow", function(){
119   - if( o.disablePageZoom ){
  118 + .bind( "pagebeforeshow", function() {
  119 + if ( o.disablePageZoom ) {
120 120 $.mobile.zoom.disable( true );
121 121 }
122   - if( !o.visibleOnPageShow ){
  122 + if ( !o.visibleOnPageShow ) {
123 123 self.hide( true );
124 124 }
125 125 } )
126   - .bind( "webkitAnimationStart animationstart updatelayout", function(){
  126 + .bind( "webkitAnimationStart animationstart updatelayout", function() {
127 127 var thisPage = this;
128   - if( o.updatePagePadding ){
  128 + if ( o.updatePagePadding ) {
129 129 self.updatePagePadding( thisPage );
130 130 }
131 131 })
132   - .bind( "pageshow", function(){
  132 + .bind( "pageshow", function() {
133 133 var thisPage = this;
134 134 self.updatePagePadding( thisPage );
135   - if( o.updatePagePadding ){
136   - $( window ).bind( "throttledresize." + self.widgetName, function(){
  135 + if ( o.updatePagePadding ) {
  136 + $( window ).bind( "throttledresize." + self.widgetName, function() {
137 137 self.updatePagePadding( thisPage );
138 138 });
139 139 }
140 140 })
141   - .bind( "pagebeforehide", function( e, ui ){
142   - if( o.disablePageZoom ){
  141 + .bind( "pagebeforehide", function( e, ui ) {
  142 + if ( o.disablePageZoom ) {
143 143 $.mobile.zoom.enable( true );
144 144 }
145   - if( o.updatePagePadding ){
  145 + if ( o.updatePagePadding ) {
146 146 $( window ).unbind( "throttledresize." + self.widgetName );
147 147 }
148 148
149   - if( o.trackPersistentToolbars ){
  149 + if ( o.trackPersistentToolbars ) {
150 150 var thisFooter = $( ".ui-footer-fixed:jqmData(id)", this ),
151 151 thisHeader = $( ".ui-header-fixed:jqmData(id)", this ),
152 152 nextFooter = thisFooter.length && ui.nextPage && $( ".ui-footer-fixed:jqmData(id='" + thisFooter.jqmData( "id" ) + "')", ui.nextPage ),
@@ -154,11 +154,11 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
154 154
155 155 nextFooter = nextFooter || $();
156 156
157   - if( nextFooter.length || nextHeader.length ){
  157 + if ( nextFooter.length || nextHeader.length ) {
158 158
159 159 nextFooter.add( nextHeader ).appendTo( $.mobile.pageContainer );
160 160
161   - ui.nextPage.one( "pageshow", function(){
  161 + ui.nextPage.one( "pageshow", function() {
162 162 nextFooter.add( nextHeader ).appendTo( this );
163 163 });
164 164 }
@@ -174,13 +174,13 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
174 174 header = $el.is( ".ui-header" );
175 175
176 176 // This behavior only applies to "fixed", not "fullscreen"
177   - if( this.options.fullscreen ){ return; }
  177 + if ( this.options.fullscreen ) { return; }
178 178
179 179 tbPage = tbPage || $el.closest( ".ui-page" );
180 180 $( tbPage ).css( "padding-" + ( header ? "top" : "bottom" ), $el.outerHeight() );
181 181 },
182 182
183   - _useTransition: function( notransition ){
  183 + _useTransition: function( notransition ) {
184 184 var $win = $( window ),
185 185 $el = this.element,
186 186 scroll = $win.scrollTop(),
@@ -198,11 +198,11 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
198 198 );
199 199 },
200 200
201   - show: function( notransition ){
  201 + show: function( notransition ) {
202 202 var hideClass = "ui-fixed-hidden",
203 203 $el = this.element;
204 204
205   - if( this._useTransition( notransition ) ){
  205 + if ( this._useTransition( notransition ) ) {
206 206 $el
207 207 .removeClass( "out " + hideClass )
208 208 .addClass( "in" );
@@ -213,17 +213,17 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
213 213 this._visible = true;
214 214 },
215 215
216   - hide: function( notransition ){
  216 + hide: function( notransition ) {
217 217 var hideClass = "ui-fixed-hidden",
218 218 $el = this.element,
219 219 // if it's a slide transition, our new transitions need the reverse class as well to slide outward
220 220 outclass = "out" + ( this.options.transition === "slide" ? " reverse" : "" );
221 221
222   - if( this._useTransition( notransition ) ){
  222 + if( this._useTransition( notransition ) ) {
223 223 $el
224 224 .addClass( outclass )
225 225 .removeClass( "in" )
226   - .animationComplete( function(){
  226 + .animationComplete(function() {
227 227 $el.addClass( hideClass ).removeClass( outclass );
228 228 });
229 229 }
@@ -233,30 +233,30 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
233 233 this._visible = false;
234 234 },
235 235
236   - toggle: function(){
  236 + toggle: function() {
237 237 this[ this._visible ? "hide" : "show" ]();
238 238 },
239 239
240   - _bindToggleHandlers: function(){
  240 + _bindToggleHandlers: function() {
241 241 var self = this,
242 242 o = self.options,
243 243 $el = self.element;
244 244
245 245 // tap toggle
246 246 $el.closest( ".ui-page" )
247   - .bind( "vclick", function( e ){
248   - if( o.tapToggle && !$( e.target ).closest( o.tapToggleBlacklist ).length ){
  247 + .bind( "vclick", function( e ) {
  248 + if ( o.tapToggle && !$( e.target ).closest( o.tapToggleBlacklist ).length ) {
249 249 self.toggle();
250 250 }
251 251 })
252   - .bind( "focusin focusout", function( e ){
253   - if( screen.width < 500 && $( e.target ).is( o.hideDuringFocus ) && !$( e.target ).closest( ".ui-header-fixed, .ui-footer-fixed" ).length ){
  252 + .bind( "focusin focusout", function( e ) {
  253 + if ( screen.width < 500 && $( e.target ).is( o.hideDuringFocus ) && !$( e.target ).closest( ".ui-header-fixed, .ui-footer-fixed" ).length ) {
254 254 self[ ( e.type === "focusin" && self._visible ) ? "hide" : "show" ]();
255 255 }
256 256 });
257 257 },
258 258
259   - destroy: function(){
  259 + destroy: function() {
260 260 this.element.removeClass( "ui-header-fixed ui-footer-fixed ui-header-fullscreen ui-footer-fullscreen in out fade slidedown slideup ui-fixed-hidden" );
261 261 this.element.closest( ".ui-page" ).removeClass( "ui-page-header-fixed ui-page-footer-fixed ui-page-header-fullscreen ui-page-footer-fullscreen" );
262 262 }
@@ -265,11 +265,11 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
265 265
266 266 //auto self-init widgets
267 267 $( document )
268   - .bind( "pagecreate create", function( e ){
  268 + .bind( "pagecreate create", function( e ) {
269 269
270 270 // DEPRECATED in 1.1: support for data-fullscreen=true|false on the page element.
271 271 // This line ensures it still works, but we recommend moving the attribute to the toolbars themselves.
272   - if( $( e.target ).jqmData( "fullscreen" ) ){
  272 + if ( $( e.target ).jqmData( "fullscreen" ) ) {
273 273 $( $.mobile.fixedtoolbar.prototype.options.initSelector, e.target ).not( ":jqmData(fullscreen)" ).jqmData( "fullscreen", true );
274 274 }
275 275
6 js/widgets/listview.filter.js
@@ -12,7 +12,7 @@ $.mobile.listview.prototype.options.filter = false;
12 12 $.mobile.listview.prototype.options.filterPlaceholder = "Filter items...";
13 13 $.mobile.listview.prototype.options.filterTheme = "c";
14 14 // TODO rename callback/deprecate and default to the item itself as the first argument
15   -$.mobile.listview.prototype.options.filterCallback = function( text, searchValue, item ){
  15 +$.mobile.listview.prototype.options.filterCallback = function( text, searchValue, item ) {
16 16 return text.toString().toLowerCase().indexOf( searchValue ) === -1;
17 17 };
18 18
@@ -36,7 +36,7 @@ $( document ).delegate( ":jqmData(role='listview')", "listviewcreate", function(
36 36 .jqmData( "lastval", "" )
37 37 .bind( "keyup change", function() {
38 38
39   - var $this = $(this),
  39 + var $this = $( this ),
40 40 val = this.value.toLowerCase(),
41 41 listItems = null,
42 42 lastval = $this.jqmData( "lastval" ) + "",
@@ -46,7 +46,7 @@ $( document ).delegate( ":jqmData(role='listview')", "listviewcreate", function(
46 46
47 47 // Change val as lastval for next execution
48 48 $this.jqmData( "lastval" , val );
49   - if ( val.length < lastval.length || val.indexOf(lastval) !== 0 ) {
  49 + if ( val.length < lastval.length || val.indexOf( lastval ) !== 0 ) {
50 50
51 51 // Removed chars or pasted something totally different, check all items
52 52 listItems = list.children();
38 js/widgets/listview.js
@@ -81,7 +81,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
81 81 .addClass( "ui-corner-tr" )
82 82 .end()
83 83 .find( ".ui-li-thumb" )
84   - .not(".ui-li-icon")
  84 + .not( ".ui-li-icon" )
85 85 .addClass( "ui-corner-tl" );
86 86
87 87 // Select the last visible li element
@@ -93,7 +93,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
93 93 .addClass( "ui-corner-br" )
94 94 .end()
95 95 .find( ".ui-li-thumb" )
96   - .not(".ui-li-icon")
  96 + .not( ".ui-li-icon" )
97 97 .addClass( "ui-corner-bl" );
98 98 }
99 99 if ( !create ) {
@@ -181,12 +181,12 @@ $.widget( "mobile.listview", $.mobile.widget, {
181 181
182 182 // If we're creating the element, we update it regardless
183 183 if ( create || !item.hasClass( "ui-li" ) ) {
184   - itemTheme = item.jqmData("theme") || o.theme;
  184 + itemTheme = item.jqmData( "theme" ) || o.theme;
185 185 a = this._getChildrenByTagName( item[ 0 ], "a", "A" );
186 186 var isDivider = ( item.jqmData( "role" ) === "list-divider" );
187 187
188 188 if ( a.length && !isDivider ) {
189   - icon = item.jqmData("icon");
  189 + icon = item.jqmData( "icon" );
190 190
191 191 item.buttonMarkup({
192 192 wrapperEls: "div",
@@ -208,7 +208,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
208 208
209 209 last = a.last();
210 210 splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme;
211   - linkIcon = last.jqmData("icon");
  211 + linkIcon = last.jqmData( "icon" );
212 212
213 213 last.appendTo(item)
214 214 .attr( "title", last.getEncodedText() )
@@ -284,12 +284,12 @@ $.widget( "mobile.listview", $.mobile.widget, {
284 284 .end()
285 285
286 286 .find( ".ui-li-aside" ).each(function() {
287   - var $this = $(this);
  287 + var $this = $( this );
288 288 $this.prependTo( $this.parent() ); //shift aside to front for css float
289 289 })
290 290 .end()
291 291
292   - .find( ".ui-li-count" ).each( function() {
  292 + .find( ".ui-li-count" ).each(function() {
293 293 $( this ).closest( "li" ).addClass( "ui-li-has-count" );
294 294 }).addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme) + " ui-btn-corner-all" );
295 295
@@ -354,16 +354,16 @@ $.widget( "mobile.listview", $.mobile.widget, {
354 354 hasSubPages = true;
355 355
356 356 newPage = list.detach()
357   - .wrap( "<div " + dns + "role='page' " + dns + "url='" + id + "' " + dns + "theme='" + theme + "' " + dns + "count-theme='" + countTheme + "'><div " + dns + "role='content'></div></div>" )
  357 + .wrap( "<div " + dns + "role='page' " + dns + "url='" + id + "' " + dns + "theme='" + theme + "' " + dns + "count-theme='" + countTheme + "'><div " + dns + "role='content'></div></div>" )
358 358 .parent()
359 359 .before( "<div " + dns + "role='header' " + dns + "theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>" )
360   - .after( persistentFooterID ? $( "<div " + dns + "role='footer' " + dns + "id='"+ persistentFooterID +"'>") : "" )
  360 + .after( persistentFooterID ? $( "<div " + dns + "role='footer' " + dns + "id='"+ persistentFooterID +"'>" ) : "" )
361 361 .parent()
362 362 .appendTo( $.mobile.pageContainer );
363 363
364 364 newPage.page();
365 365
366   - anchor = parent.find('a:first');
  366 + anchor = parent.find( 'a:first' );
367 367
368 368 if ( !anchor.length ) {
369 369 anchor = $( "<a/>" ).html( nodeEls || title ).prependTo( parent.empty() );
@@ -375,20 +375,20 @@ $.widget( "mobile.listview", $.mobile.widget, {
375 375
376 376 // on pagehide, remove any nested pages along with the parent page, as long as they aren't active
377 377 // and aren't embedded
378   - if( hasSubPages &&
  378 + if ( hasSubPages &&
379 379 parentPage.is( ":jqmData(external-page='true')" ) &&
380   - parentPage.data("page").options.domCache === false ) {
  380 + parentPage.data( "page" ).options.domCache === false ) {
381 381
382   - var newRemove = function( e, ui ){
  382 + var newRemove = function( e, ui ) {
383 383 var nextPage = ui.nextPage, npURL,
384 384 prEvent = new $.Event( "pageremove" );
385 385
386   - if( ui.nextPage ){
  386 + if ( ui.nextPage ) {
387 387 npURL = nextPage.jqmData( "url" );
388   - if( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ){
  388 + if ( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ) {
389 389 self.childPages().remove();
390 390 parentPage.trigger( prEvent );
391   - if( !prEvent.isDefaultPrevented() ){
  391 + if ( !prEvent.isDefaultPrevented() ) {
392 392 parentPage.removeWithDependents();
393 393 }
394 394 }
@@ -403,15 +403,15 @@ $.widget( "mobile.listview", $.mobile.widget, {
403 403 },
404 404
405 405 // TODO sort out a better way to track sub pages of the listview this is brittle
406   - childPages: function(){
  406 + childPages: function() {
407 407 var parentUrl = this.parentPage.jqmData( "url" );
408 408
409   - return $( ":jqmData(url^='"+ parentUrl + "&" + $.mobile.subPageUrlKey +"')");
  409 + return $( ":jqmData(url^='"+ parentUrl + "&" + $.mobile.subPageUrlKey + "')" );
410 410 }
411 411 });
412 412
413 413 //auto self-init widgets
414   -$( document ).bind( "pagecreate create", function( e ){
  414 +$( document ).bind( "pagecreate create", function( e ) {
415 415 $.mobile.listview.prototype.enhanceWithin( e.target );
416 416 });
417 417
28 js/widgets/loader.js
@@ -9,7 +9,7 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
9 9 (function( $, window ) {
10 10 // DEPRECATED
11 11 // NOTE global mobile object settings
12   - $.extend($.mobile, {
  12 + $.extend( $.mobile, {
13 13 // DEPRECATED Should the text be visble in the loading message?
14 14 loadingMessageTextVisible: undefined,
15 15
@@ -33,7 +33,7 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
33 33 },
34 34
35 35 loading: function() {
36   - this.loaderWidget.loader.apply(this.loaderWidget, arguments);
  36 + this.loaderWidget.loader.apply( this.loaderWidget, arguments );
37 37 }
38 38 });
39 39
@@ -63,7 +63,7 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
63 63 "</div>",
64 64
65 65 // For non-fixed supportin browsers. Position at y center (if scrollTop supported), above the activeBtn (if defined), or just 100px from top
66   - fakeFixLoader: function(){
  66 + fakeFixLoader: function() {
67 67 var activeBtn = $( "." + $.mobile.activeBtnClass ).first();
68 68
69 69 this.element
@@ -75,12 +75,12 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
75 75
76 76 // check position of loader to see if it appears to be "fixed" to center
77 77 // if not, use abs positioning
78   - checkLoaderPosition: function(){
  78 + checkLoaderPosition: function() {
79 79 var offset = this.element.offset(),
80 80 scrollTop = $window.scrollTop(),
81 81 screenHeight = $.mobile.getScreenHeight();
82 82
83   - if( offset.top < scrollTop || (offset.top - scrollTop) > screenHeight ) {
  83 + if ( offset.top < scrollTop || ( offset.top - scrollTop ) > screenHeight ) {
84 84 this.element.addClass( "ui-loader-fakefix" );
85 85 this.fakeFixLoader();
86 86 $window
@@ -90,7 +90,7 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
90 90 },
91 91
92 92 resetHtml: function() {
93   - this.element.html( $(this.defaultHtml).html() );
  93 + this.element.html( $( this.defaultHtml ).html() );
94 94 },
95 95
96 96 // Turn on/off page loading message. Theme doubles as an object argument
@@ -104,8 +104,8 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
104 104
105 105 // use the prototype options so that people can set them globally at
106 106 // mobile init. Consistency, it's what's for dinner
107   - if( $.type(theme) === "object" ){
108   - loadSettings = $.extend({}, this.options, theme);
  107 + if ( $.type(theme) === "object" ) {
  108 + loadSettings = $.extend( {}, this.options, theme );
109 109
110 110 // prefer object property from the param then the old theme setting
111 111 theme = loadSettings.theme || $.mobile.loadingMessageTheme;
@@ -128,7 +128,7 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
128 128 if ( $.mobile.loadingMessage !== false || loadSettings.html ) {
129 129 // boolean values require a bit more work :P, supports object properties
130 130 // and old settings
131   - if( $.mobile.loadingMessageTextVisible !== undefined ) {
  131 + if ( $.mobile.loadingMessageTextVisible !== undefined ) {
132 132 textVisible = $.mobile.loadingMessageTextVisible;
133 133 } else {
134 134 textVisible = loadSettings.textVisible;
@@ -146,7 +146,7 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
146 146 // this might be overly defensive in preventing unknowing xss
147 147 // if the html attribute is defined on the loading settings, use that
148 148 // otherwise use the fallbacks from above
149   - if( loadSettings.html ) {
  149 + if ( loadSettings.html ) {
150 150 this.element.html( loadSettings.html );
151 151 } else {
152 152 this.element.find( "h1" ).text( message );
@@ -159,19 +159,19 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
159 159 this.checkLoaderPosition();
160 160
161 161 // on scroll check the loader position
162   - $window.bind( "scroll", $.proxy(this.checkLoaderPosition, this));
  162 + $window.bind( "scroll", $.proxy( this.checkLoaderPosition, this ) );
163 163 }
164 164 },
165 165
166 166 hide: function() {
167 167 $html.removeClass( "ui-loading" );
168 168
169   - if( $.mobile.loadingMessage ){
  169 + if ( $.mobile.loadingMessage ) {
170 170 this.element.removeClass( "ui-loader-fakefix" );
171 171 }
172 172
173   - $( window ).unbind( "scroll", $.proxy(this.fakeFixLoader, this) );
174   - $( window ).unbind( "scroll", $.proxy(this.checkLoaderPosition, this) );
  173 + $( window ).unbind( "scroll", $.proxy( this.fakeFixLoader, this) );
  174 + $( window ).unbind( "scroll", $.proxy( this.checkLoaderPosition, this ) );
175 175 }
176 176 });
177 177
8 js/widgets/navbar.js
@@ -17,7 +17,7 @@ $.widget( "mobile.navbar", $.mobile.widget, {
17 17 initSelector: ":jqmData(role='navbar')"
18 18 },
19 19
20   - _create: function(){
  20 + _create: function() {
21 21
22 22 var $navbar = this.element,
23 23 $navbtns = $navbar.find( "a" ),
@@ -25,7 +25,7 @@ $.widget( "mobile.navbar", $.mobile.widget, {
25 25 this.options.iconpos : undefined;
26 26
27 27 $navbar.addClass( "ui-navbar ui-mini" )
28   - .attr( "role","navigation" )
  28 + .attr( "role", "navigation" )
29 29 .find( "ul" )
30 30 .jqmEnhanceable()
31 31 .grid({ grid: this.options.grid });
@@ -38,7 +38,7 @@ $.widget( "mobile.navbar", $.mobile.widget, {
38 38 });
39 39
40 40 $navbar.delegate( "a", "vclick", function( event ) {
41   - if( !$(event.target).hasClass("ui-disabled") ) {
  41 + if ( !$(event.target).hasClass( "ui-disabled" ) ) {
42 42 $navbtns.removeClass( $.mobile.activeBtnClass );
43 43 $( this ).addClass( $.mobile.activeBtnClass );
44 44 }
@@ -52,7 +52,7 @@ $.widget( "mobile.navbar", $.mobile.widget, {
52 52 });
53 53
54 54 //auto self-init widgets
55   -$( document ).bind( "pagecreate create", function( e ){
  55 +$( document ).bind( "pagecreate create", function( e ) {
56 56 $.mobile.navbar.prototype.enhanceWithin( e.target );
57 57 });
58 58
18 js/widgets/page.js
@@ -19,39 +19,39 @@ $.widget( "mobile.page", $.mobile.widget, {
19 19 var self = this;
20 20
21 21 // if false is returned by the callbacks do not create the page
22   - if( self._trigger( "beforecreate" ) === false ){
  22 + if ( self._trigger( "beforecreate" ) === false ) {
23 23 return false;
24 24 }
25 25
26 26 self.element
27 27 .attr( "tabindex", "0" )
28 28 .addClass( "ui-page ui-body-" + self.options.theme )
29   - .bind( "pagebeforehide", function(){
  29 + .bind( "pagebeforehide", function() {
30 30 self.removeContainerBackground();
31 31 } )
32   - .bind( "pagebeforeshow", function(){
  32 + .bind( "pagebeforeshow", function() {
33 33 self.setContainerBackground();
34 34 } );
35 35
36 36 },
37 37
38   - removeContainerBackground: function(){
  38 + removeContainerBackground: function() {
39 39 $.mobile.pageContainer.removeClass( "ui-overlay-" + $.mobile.getInheritedTheme( this.element.parent() ) );
40 40 },
41 41
42 42 // set the page container background to the page theme
43   - setContainerBackground: function( theme ){
44   - if( this.options.theme ){
  43 + setContainerBackground: function( theme ) {
  44 + if ( this.options.theme ) {
45 45 $.mobile.pageContainer.addClass( "ui-overlay-" + ( theme || this.options.theme ) );
46 46 }
47 47 },
48 48
49 49 keepNativeSelector: function() {
50 50 var options = this.options,
51   - keepNativeDefined = options.keepNative && $.trim(options.keepNative);
  51 + keepNativeDefined = options.keepNative && $.trim( options.keepNative );
52 52
53   - if( keepNativeDefined && options.keepNative !== options.keepNativeDefault ){
54   - return [options.keepNative, options.keepNativeDefault].join(", ");
  53 + if ( keepNativeDefined && options.keepNative !== options.keepNativeDefault ) {
  54 + return [options.keepNative, options.keepNativeDefault].join( ", " );
55 55 }
56 56
57 57 return options.keepNativeDefault;
2  js/widgets/page.sections.js
@@ -50,7 +50,7 @@ $( document ).bind( "pagecreate", function( e ) {
50 50 // Add ARIA role
51 51 .attr( "role", role === "header" ? "banner" : "contentinfo" );
52 52
53   - if( role === "header") {
  53 + if ( role === "header") {
54 54 // Right,left buttons
55 55 $headeranchors = $this.children( "a, button" );
56 56 leftbtn = $headeranchors.hasClass( "ui-btn-left" );
24 js/widgets/popup.js
@@ -37,9 +37,9 @@ define( [ "jquery",
37 37
38 38 _create: function() {
39 39 var ui = {
40   - screen: $("<div class='ui-screen-hidden ui-popup-screen fade'></div>"),
41   - placeholder: $("<div style='display: none;'><!-- placeholder --></div>"),
42   - container: $("<div class='ui-popup-container ui-selectmenu-hidden'></div>")
  40 + screen: $( "<div class='ui-screen-hidden ui-popup-screen fade'></div>" ),
  41 + placeholder: $( "<div style='display: none;'><!-- placeholder --></div>" ),
  42 + container: $( "<div class='ui-popup-container ui-selectmenu-hidden'></div>" )
43 43 },
44 44 eatEventAndClose = function( e ) {
45 45 e.preventDefault();
@@ -227,15 +227,15 @@ define( [ "jquery",
227 227 var self = this, prereqs;
228 228
229 229 prereqs = {
230   - screen: $.Deferred( function( d ) {
231   - d.then( function() {
  230 + screen: $.Deferred(function( d ) {
  231 + d.then(function() {
232 232 if ( prereqs === self._prereqs ) {
233 233 screenPrereq();
234 234 }
235 235 });
236 236 }),
237   - container: $.Deferred( function( d ) {
238   - d.then( function() {
  237 + container: $.Deferred(function( d ) {
  238 + d.then(function() {
239 239 if ( prereqs === self._prereqs ) {
240 240 containerPrereq();
241 241 }
@@ -243,7 +243,7 @@ define( [ "jquery",
243 243 })
244 244 };
245 245
246   - $.when( prereqs.screen, prereqs.container ).done( function() {
  246 + $.when( prereqs.screen, prereqs.container ).done(function() {
247 247 if ( prereqs === self._prereqs ) {
248 248 self._prereqs = null;
249 249 whenDone();
@@ -260,7 +260,7 @@ define( [ "jquery",
260 260 self._ui.screen
261 261 .removeClass( args.classToRemove )
262 262 .addClass( args.screenClassToAdd )
263   - .animationComplete( function() {
  263 + .animationComplete(function() {
264 264 args.prereqs.screen.resolve();
265 265 });
266 266 } else {
@@ -272,7 +272,7 @@ define( [ "jquery",
272 272 self._ui.container
273 273 .addClass( args.containerClassToAdd )
274 274 .removeClass( args.classToRemove )
275   - .animationComplete( function() {
  275 + .animationComplete(function() {
276 276 args.prereqs.container.resolve();
277 277 });
278 278 } else {
@@ -299,7 +299,7 @@ define( [ "jquery",
299 299 },
300 300 function() {
301 301 self._isOpen = true;
302   - self._ui.container.attr("tabindex", "0" ).focus();
  302 + self._ui.container.attr( "tabindex", "0" ).focus();
303 303 self.element.trigger( "opened" );
304 304 });
305 305
@@ -484,7 +484,7 @@ define( [ "jquery",
484 484 if ( !self._currentlyOpenPopup ) {
485 485 self._currentlyOpenPopup = popup;
486 486
487   - self._navHook( function() {
  487 + self._navHook(function() {
488 488 self._popupIsOpening = true;
489 489 self._currentlyOpenPopup.element.one( "opened", function() {
490 490 self._popupIsOpening = false;

0 comments on commit 14d8c07

Please sign in to comment.
Something went wrong with that request. Please try again.