File tree Expand file tree Collapse file tree 1 file changed +18
-16
lines changed Expand file tree Collapse file tree 1 file changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -176,26 +176,28 @@ asyncTest( "Form resets correctly", function() {
176
176
wentToTestPage = true ;
177
177
$ ( "#goToTestPage" ) . click ( ) ;
178
178
}
179
- } ;
180
-
181
- $ ( document ) . bind ( "pageshow" , function ( e ) {
182
- if ( e . target . id === "testPage" ) {
183
- setTimeout ( function ( ) {
184
- runTest ( e . target , function ( ) {
185
- testComplete = true ;
186
- setTimeout ( function ( ) { $ ( "#goToStartPage" ) . click ( ) ; } ) ;
179
+ } ,
180
+ handlePageShow = function ( e ) {
181
+ if ( e . target . id === "testPage" ) {
182
+ setTimeout ( function ( ) {
183
+ runTest ( e . target , function ( ) {
184
+ testComplete = true ;
185
+ setTimeout ( function ( ) { $ ( "#goToStartPage" ) . click ( ) ; } ) ;
186
+ } ) ;
187
187
} ) ;
188
- } ) ;
189
- } else if ( e . target . id === "startPage" ) {
190
- if ( wentToTestPage ) {
191
- if ( testComplete ) {
192
- start ( ) ;
188
+ } else if ( e . target . id === "startPage" ) {
189
+ if ( wentToTestPage ) {
190
+ if ( testComplete ) {
191
+ $ ( document ) . unbind ( "pageshow" , handlePageShow ) ;
192
+ start ( ) ;
193
+ }
194
+ } else {
195
+ setTimeout ( maybeGoToTestPage ) ;
193
196
}
194
- } else {
195
- setTimeout ( maybeGoToTestPage ) ;
196
197
}
197
198
}
198
- } ) ;
199
+
200
+ $ ( document ) . bind ( "pageshow" , handlePageShow ) ;
199
201
200
202
setTimeout ( maybeGoToTestPage ) ;
201
203
} ) ;
You can’t perform that action at this time.
0 commit comments