CB-2408: There should be a check for the browser history, but the logic intentionally doesn't match

This commit is contained in:
Joe Bowser 2013-02-12 11:16:01 -08:00
parent 2683803ef3
commit f9d27e4a67

View File

@ -554,15 +554,14 @@ public class CordovaWebView extends WebView {
// Check webview first to see if there is a history // Check webview first to see if there is a history
// This is needed to support curPage#diffLink, since they are added to appView's history, but not our history url array (JQMobile behavior) // This is needed to support curPage#diffLink, since they are added to appView's history, but not our history url array (JQMobile behavior)
if (super.canGoBack()) { if (super.canGoBack() && this.useBrowserHistory) {
printBackForwardList(); printBackForwardList();
super.goBack(); super.goBack();
return true; return true;
} }
// If our managed history has prev url // If our managed history has prev url
if (this.urls.size() > 1 && !this.useBrowserHistory) { else if (this.urls.size() > 1 && !this.useBrowserHistory) {
this.urls.pop(); // Pop current url this.urls.pop(); // Pop current url
String url = this.urls.pop(); // Pop prev url that we want to load, since it will be added back by loadUrl() String url = this.urls.pop(); // Pop prev url that we want to load, since it will be added back by loadUrl()
this.loadUrl(url); this.loadUrl(url);
@ -578,10 +577,10 @@ public class CordovaWebView extends WebView {
* @return * @return
*/ */
public boolean canGoBack() { public boolean canGoBack() {
if (super.canGoBack()) { if (super.canGoBack() && this.useBrowserHistory) {
return true; return true;
} }
if (this.urls.size() > 1) { else if (this.urls.size() > 1) {
return true; return true;
} }
return false; return false;