You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2012/07/14 02:24:43 UTC

[44/46] wp7 commit: back button fix

back button fix


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/commit/093d645c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/tree/093d645c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/diff/093d645c

Branch: refs/heads/master
Commit: 093d645c597b51ab5e570f8421cc1113a8989435
Parents: ed93749
Author: Sergei Grebnov <se...@akvelon.com>
Authored: Tue Jul 10 14:52:18 2012 +0400
Committer: Sergei Grebnov <se...@akvelon.com>
Committed: Tue Jul 10 14:52:18 2012 +0400

----------------------------------------------------------------------
 framework/CordovaView.xaml.cs |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7/blob/093d645c/framework/CordovaView.xaml.cs
----------------------------------------------------------------------
diff --git a/framework/CordovaView.xaml.cs b/framework/CordovaView.xaml.cs
index f9a6e0b..8a14362 100644
--- a/framework/CordovaView.xaml.cs
+++ b/framework/CordovaView.xaml.cs
@@ -338,9 +338,14 @@ namespace WP7CordovaClassLib
                 try
                 {
                     PageDidChange = false;
+
+                    Uri uriBefore = this.Browser.Source;
                     // calling js history.back with result in a page change if history was valid.
                     CordovaBrowser.InvokeScript("eval", new string[] { "(function(){window.history.back();})()" });
-                    e.Cancel = PageDidChange;
+                    
+                    Uri uriAfter = this.Browser.Source;
+
+                    e.Cancel = PageDidChange || (uriBefore != uriAfter);
                 }
                 catch (Exception)
                 {