Skip to content

Commit 3a24aa4

Browse files
committed
Merge branch 'external-clear' of https://github.com/ajkovar/jquery-mobile into ajkovar-external-clear
2 parents 7da26e1 + e3a5dd5 commit 3a24aa4

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

js/jquery.mobile.navigation.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,6 @@
117117
urlHistory.stack = urlHistory.stack.slice( 0, urlHistory.activeIndex + 1 );
118118
},
119119

120-
//wipe all urls
121-
clear: function(){
122-
urlHistory.stack = [];
123-
urlHistory.activeIndex = 0;
124-
},
125-
126120
//disable hashchange event listener internally to ignore one change
127121
//toggled internally when location.hash is updated to match the url of a successful page load
128122
ignoreNextHashChange: true
@@ -562,7 +556,9 @@
562556
error: function() {
563557
$.mobile.pageLoading( true );
564558
removeActiveLinkClass(true);
565-
base.set(path.get());
559+
if(base){
560+
base.set(path.get());
561+
}
566562
$("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h1>Error Loading Page</h1></div>")
567563
.css({ "display": "block", "opacity": 0.96, "top": $(window).scrollTop() + 100 })
568564
.appendTo( $.mobile.pageContainer )

tests/unit/navigation/navigation_transitions.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@
4040
}
4141
};
4242
checkTransitionStack();
43+
},
44+
45+
//wipe all urls
46+
clearUrlHistory = function(){
47+
$.mobile.urlHistory.stack = [];
48+
$.mobile.urlHistory.activeIndex = 0;
4349
};
4450

4551

@@ -60,7 +66,7 @@
6066

6167
QUnit.testStart = function (name) {
6268
clearPageTransitionStack();
63-
$.mobile.urlHistory.clear();
69+
clearUrlHistory();
6470
};
6571

6672
test( "changePage applys perspective class to mobile viewport for flip", function(){
@@ -119,14 +125,12 @@
119125
ok(isTransitioningIn(firstPage), "first page begins transition");
120126
ok(!isTransitioningIn(secondPage), "second page doesn't transition yet");
121127

128+
finishPageTransition();
129+
122130
setTimeout(function(){
123-
finishPageTransition();
124-
125-
setTimeout(function(){
126-
ok(!isTransitioningIn(firstPage), "first page transition should be complete");
127-
ok(isTransitioningIn(secondPage), "second page should begin transitioning");
128-
start();
129-
},0);
131+
ok(!isTransitioningIn(firstPage), "first page transition should be complete");
132+
ok(isTransitioningIn(secondPage), "second page should begin transitioning");
133+
start();
130134
},0);
131135
},0);
132136
});

0 commit comments

Comments
 (0)