Skip to content

Commit 654e463

Browse files
committed
Panel: Style fixes powered by esformatter
Closes jquery-archivegh-8105
1 parent f9d2d04 commit 654e463

File tree

6 files changed

+701
-701
lines changed

6 files changed

+701
-701
lines changed

js/widgets/panel.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
// Browser globals
2929
factory( jQuery );
3030
}
31-
})( function( $ ) {
31+
} )( function( $ ) {
3232

3333
return $.widget( "mobile.panel", {
3434
version: "@VERSION",
@@ -77,8 +77,8 @@ return $.widget( "mobile.panel", {
7777
_page: this._getPage,
7878
_panelInner: this._getPanelInner(),
7979
_fixedToolbars: this._getFixedToolbars
80-
});
81-
if ( this.options.display !== "overlay" ){
80+
} );
81+
if ( this.options.display !== "overlay" ) {
8282
this._getWrapper();
8383
}
8484
this._addPanelClasses();
@@ -117,7 +117,7 @@ return $.widget( "mobile.panel", {
117117
self._modal = $( "<div class='" + self.options.classes.modal + "'></div>" )
118118
.on( "mousedown", function() {
119119
self.close();
120-
})
120+
} )
121121
.appendTo( target );
122122
},
123123

@@ -176,11 +176,11 @@ return $.widget( "mobile.panel", {
176176
_bindCloseEvents: function() {
177177
this._on( this._closeLink, {
178178
"click": "_handleCloseClick"
179-
});
179+
} );
180180

181-
this._on({
181+
this._on( {
182182
"click a:jqmData(ajax='false')": "_handleCloseClick"
183-
});
183+
} );
184184
},
185185

186186
_positionPanel: function( scrollToTop ) {
@@ -212,7 +212,7 @@ return $.widget( "mobile.panel", {
212212
},
213213

214214
_bindFixListener: function() {
215-
this._on( $( window ), { "throttledresize": "_positionPanel" });
215+
this._on( $( window ), { "throttledresize": "_positionPanel" } );
216216
},
217217

218218
_unbindFixListener: function() {
@@ -234,17 +234,17 @@ return $.widget( "mobile.panel", {
234234
_bindUpdateLayout: function() {
235235
var self = this;
236236

237-
self.element.on( "updatelayout", function(/* e */) {
237+
self.element.on( "updatelayout", function( /* e */ ) {
238238
if ( self._open ) {
239239
self._positionPanel();
240240
}
241-
});
241+
} );
242242
},
243243

244244
_bindLinkListeners: function() {
245245
this._on( "body", {
246246
"click a": "_handleClick"
247-
});
247+
} );
248248

249249
},
250250

@@ -260,7 +260,7 @@ return $.widget( "mobile.panel", {
260260
link.addClass( $.mobile.activeBtnClass );
261261
this.element.one( "panelopen panelclose", function() {
262262
link.removeClass( $.mobile.activeBtnClass );
263-
});
263+
} );
264264
}
265265
this.toggle();
266266
}
@@ -291,34 +291,34 @@ return $.widget( "mobile.panel", {
291291
if ( self._open && e.target !== self.element[ 0 ] ) {
292292
self.close();
293293
}
294-
})
294+
} )
295295
// On escape, close? might need to have a target check too...
296296
.on( "keyup.panel", function( e ) {
297297
if ( e.keyCode === 27 && self._open ) {
298298
self.close();
299299
}
300-
});
300+
} );
301301
if ( !this._parentPage && this.options.display !== "overlay" ) {
302302
this._on( this.document, {
303303
"pageshow": function() {
304304
this._openedPage = null;
305305
this._getWrapper();
306306
}
307-
});
307+
} );
308308
}
309309
// Clean up open panels after page hide
310310
if ( self._parentPage ) {
311311
this.document.on( "pagehide", ":jqmData(role='page')", function() {
312312
if ( self._open ) {
313313
self.close( true );
314314
}
315-
});
315+
} );
316316
} else {
317317
this.document.on( "pagebeforehide", function() {
318318
if ( self._open ) {
319319
self.close( true );
320320
}
321-
});
321+
} );
322322
}
323323
},
324324

@@ -333,7 +333,7 @@ return $.widget( "mobile.panel", {
333333
o = self.options,
334334

335335
_openPanel = function() {
336-
self._off( self.document , "panelclose" );
336+
self._off( self.document, "panelclose" );
337337
self._page().jqmData( "panel", "open" );
338338

339339
if ( $.support.cssTransform3d && !!o.animate && o.display !== "overlay" ) {
@@ -398,7 +398,7 @@ return $.widget( "mobile.panel", {
398398
if ( self._page().jqmData( "panel" ) === "open" ) {
399399
self._on( self.document, {
400400
"panelclose": _openPanel
401-
});
401+
} );
402402
} else {
403403
_openPanel();
404404
}
@@ -485,8 +485,8 @@ return $.widget( "mobile.panel", {
485485

486486
_destroy: function() {
487487
var otherPanels,
488-
o = this.options,
489-
multiplePanels = ( $( "body > :mobile-panel" ).length + $.mobile.activePage.find( ":mobile-panel" ).length ) > 1;
488+
o = this.options,
489+
multiplePanels = ( $( "body > :mobile-panel" ).length + $.mobile.activePage.find( ":mobile-panel" ).length ) > 1;
490490

491491
if ( o.display !== "overlay" ) {
492492

@@ -535,6 +535,6 @@ return $.widget( "mobile.panel", {
535535
this._modal.remove();
536536
}
537537
}
538-
});
538+
} );
539539

540-
});
540+
} );

tests/integration/panel/external_panel_core.js

Lines changed: 88 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -2,101 +2,101 @@ var panel = $( "#wrapper-test-panel" ).panel(),
22
stretchTestPanel = $( "#panel-stretch-test" ).panel();
33

44
asyncTest( "External panel updates wrapper correctly", function() {
5-
var otherPageChildren,
6-
thisPage = $( "#start-page" ),
7-
otherPage = $( "#other-page" ),
8-
otherPageLink = $( "#go-to-other-page" );
5+
var otherPageChildren,
6+
thisPage = $( "#start-page" ),
7+
otherPage = $( "#other-page" ),
8+
otherPageLink = $( "#go-to-other-page" );
99

10-
expect( 7 );
10+
expect( 7 );
1111

12-
$.testHelper.detailedEventCascade([
13-
function() {
14-
panel.panel( "open" );
15-
},
16-
{
17-
panelopen: { src: panel, event: "panelopen.externalPanelUpdatesWrapperCorrectly1" }
18-
},
19-
function( result ) {
20-
deepEqual( result.panelopen.timedOut, false, "Panel did open" );
21-
deepEqual( thisPage.data( $.mobile.ns + "panel" ), "open",
22-
"Data at key 'panel' on opening page present" );
23-
otherPageLink.click();
24-
},
25-
{
26-
panelclose: { src: panel, event: "panelclose.externalPanelUpdatesWrapperCorrectly2" },
27-
pagecontainerchange: {
28-
src: $( window ),
29-
event: "pagecontainerchange.externalPanelUpdatesWrapperCorrectly2"
30-
}
31-
},
32-
function( result ) {
33-
otherPageChildren = otherPage.children();
34-
deepEqual( result.panelclose.timedOut, false, "Panel did close upon link click" );
35-
deepEqual( result.pagecontainerchange.timedOut, false,
36-
"pagecontainerchange event received" );
37-
deepEqual( otherPageChildren.length, 1, "Other page has exactly one child" );
38-
deepEqual( otherPageChildren.hasClass( "ui-panel-wrapper" ), true,
39-
"Other page child has class 'ui-panel-wrapper'" );
40-
deepEqual( thisPage.data( $.mobile.ns + "panel" ), undefined,
41-
"Data at key 'panel' on opening page absent" );
42-
$.mobile.back();
43-
},
44-
{
45-
pagecontainerchange: {
46-
src: $( window ),
47-
event: "pagecontainerchange.externalPanelUpdatesWrapperCorrectly2"
48-
}
49-
},
50-
start
51-
]);
52-
});
12+
$.testHelper.detailedEventCascade( [
13+
function() {
14+
panel.panel( "open" );
15+
},
16+
{
17+
panelopen: { src: panel, event: "panelopen.externalPanelUpdatesWrapperCorrectly1" }
18+
},
19+
function( result ) {
20+
deepEqual( result.panelopen.timedOut, false, "Panel did open" );
21+
deepEqual( thisPage.data( $.mobile.ns + "panel" ), "open",
22+
"Data at key 'panel' on opening page present" );
23+
otherPageLink.click();
24+
},
25+
{
26+
panelclose: { src: panel, event: "panelclose.externalPanelUpdatesWrapperCorrectly2" },
27+
pagecontainerchange: {
28+
src: $( window ),
29+
event: "pagecontainerchange.externalPanelUpdatesWrapperCorrectly2"
30+
}
31+
},
32+
function( result ) {
33+
otherPageChildren = otherPage.children();
34+
deepEqual( result.panelclose.timedOut, false, "Panel did close upon link click" );
35+
deepEqual( result.pagecontainerchange.timedOut, false,
36+
"pagecontainerchange event received" );
37+
deepEqual( otherPageChildren.length, 1, "Other page has exactly one child" );
38+
deepEqual( otherPageChildren.hasClass( "ui-panel-wrapper" ), true,
39+
"Other page child has class 'ui-panel-wrapper'" );
40+
deepEqual( thisPage.data( $.mobile.ns + "panel" ), undefined,
41+
"Data at key 'panel' on opening page absent" );
42+
$.mobile.back();
43+
},
44+
{
45+
pagecontainerchange: {
46+
src: $( window ),
47+
event: "pagecontainerchange.externalPanelUpdatesWrapperCorrectly2"
48+
}
49+
},
50+
start
51+
] );
52+
} );
5353

5454
asyncTest( "External panel stretches to acommodate page height", function( assert ) {
55-
expect( 4 );
55+
expect( 4 );
5656

57-
var eventNs = ".externalPanelStretches";
57+
var eventNs = ".externalPanelStretches";
5858

59-
$.testHelper.detailedEventCascade( [
60-
function() {
61-
$( "body" ).pagecontainer( "change", "#panel-stretch-page" );
62-
},
63-
{
64-
pagecontainerchange: { src: $( window ), event: "pagecontainerchange" + eventNs + "1" }
65-
},
66-
function( result ) {
67-
assert.deepEqual( result.pagecontainerchange.timedOut, false,
68-
"Successfully changed to page '#panel-stretch-page'" );
59+
$.testHelper.detailedEventCascade( [
60+
function() {
61+
$( "body" ).pagecontainer( "change", "#panel-stretch-page" );
62+
},
63+
{
64+
pagecontainerchange: { src: $( window ), event: "pagecontainerchange" + eventNs + "1" }
65+
},
66+
function( result ) {
67+
assert.deepEqual( result.pagecontainerchange.timedOut, false,
68+
"Successfully changed to page '#panel-stretch-page'" );
6969

70-
// Make the page scroll
71-
$( "#panel-stretch-page .ui-content" ).height( $.mobile.getScreenHeight() * 3 );
70+
// Make the page scroll
71+
$( "#panel-stretch-page .ui-content" ).height( $.mobile.getScreenHeight() * 3 );
7272

73-
stretchTestPanel.panel( "open" );
74-
},
75-
{
76-
panelopen: { src: stretchTestPanel, event: "panelopen" + eventNs + "2" }
77-
},
78-
function( result ) {
73+
stretchTestPanel.panel( "open" );
74+
},
75+
{
76+
panelopen: { src: stretchTestPanel, event: "panelopen" + eventNs + "2" }
77+
},
78+
function( result ) {
7979

80-
// Making assertions about the document height has to happen immediately after the
81-
// operation that modifies the document height takes place, because the act of
82-
// recording the assertion itself may modify the document height, because QUnit will
83-
// insert new DOM elements to visually record the assertion, and the addition of such
84-
// DOM elements may affect the document height.
85-
assert.deepEqual( stretchTestPanel.outerHeight( true ), $( document ).height(),
86-
"Panel is as tall as the document" );
87-
assert.deepEqual( result.panelopen.timedOut, false, "Panel opened successfully" );
88-
stretchTestPanel.panel( "close" );
89-
},
90-
{
91-
panelclose: { src: stretchTestPanel, event: "panelclose" + eventNs + "3" }
92-
},
93-
function( result ) {
94-
assert.deepEqual( result.panelclose.timedOut, false, "Panel closedsuccessfully" );
95-
$.mobile.back();
96-
},
97-
{
98-
pagecontainerchange: { src: $( window ), event: "pagecontainerchange" + eventNs + "4" }
99-
},
100-
start
101-
] );
80+
// Making assertions about the document height has to happen immediately after the
81+
// operation that modifies the document height takes place, because the act of
82+
// recording the assertion itself may modify the document height, because QUnit will
83+
// insert new DOM elements to visually record the assertion, and the addition of such
84+
// DOM elements may affect the document height.
85+
assert.deepEqual( stretchTestPanel.outerHeight( true ), $( document ).height(),
86+
"Panel is as tall as the document" );
87+
assert.deepEqual( result.panelopen.timedOut, false, "Panel opened successfully" );
88+
stretchTestPanel.panel( "close" );
89+
},
90+
{
91+
panelclose: { src: stretchTestPanel, event: "panelclose" + eventNs + "3" }
92+
},
93+
function( result ) {
94+
assert.deepEqual( result.panelclose.timedOut, false, "Panel closedsuccessfully" );
95+
$.mobile.back();
96+
},
97+
{
98+
pagecontainerchange: { src: $( window ), event: "pagecontainerchange" + eventNs + "4" }
99+
},
100+
start
101+
] );
102102
} );

0 commit comments

Comments
 (0)