You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2013/02/12 20:16:16 UTC

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

Updated Branches:
  refs/heads/master 2683803ef -> f9d27e4a6


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


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/f9d27e4a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/f9d27e4a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/f9d27e4a

Branch: refs/heads/master
Commit: f9d27e4a67a7abe42a1828005c2647233ea3584c
Parents: 2683803
Author: Joe Bowser <bo...@apache.org>
Authored: Tue Feb 12 11:16:01 2013 -0800
Committer: Joe Bowser <bo...@apache.org>
Committed: Tue Feb 12 11:16:01 2013 -0800

----------------------------------------------------------------------
 .../src/org/apache/cordova/CordovaWebView.java     |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/f9d27e4a/framework/src/org/apache/cordova/CordovaWebView.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java
index 44c9299..8f12822 100755
--- a/framework/src/org/apache/cordova/CordovaWebView.java
+++ b/framework/src/org/apache/cordova/CordovaWebView.java
@@ -554,15 +554,14 @@ public class CordovaWebView extends WebView {
 
         // 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)
-        if (super.canGoBack()) {
+        if (super.canGoBack() && this.useBrowserHistory) {
             printBackForwardList();
             super.goBack();
             
             return true;
         }
-
         // 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
             String url = this.urls.pop();   // Pop prev url that we want to load, since it will be added back by loadUrl()
             this.loadUrl(url);
@@ -578,10 +577,10 @@ public class CordovaWebView extends WebView {
      * @return
      */
     public boolean canGoBack() {
-        if (super.canGoBack()) {
+        if (super.canGoBack() && this.useBrowserHistory) {
             return true;
         }
-        if (this.urls.size() > 1) {
+        else if (this.urls.size() > 1) {
             return true;
         }
         return false;