diff options
| author | Misko Hevery | 2013-05-02 14:12:48 -0400 |
|---|---|---|
| committer | Misko Hevery | 2013-05-02 15:22:17 -0400 |
| commit | 4bd7bedf48c0c1ebb62f6bd8c85e8ea00f94502b (patch) | |
| tree | 82ffeee6a096bca33c70a8b4b6d2ba1a3917665e /src | |
| parent | fd21c7502f0a25364a810c26ebeecb678e5783c5 (diff) | |
| download | angular.js-4bd7bedf48c0c1ebb62f6bd8c85e8ea00f94502b.tar.bz2 | |
fix($location): prevent navigation if already on the URL
Diffstat (limited to 'src')
| -rw-r--r-- | src/ng/location.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ng/location.js b/src/ng/location.js index b6d14e1a..1a7f4208 100644 --- a/src/ng/location.js +++ b/src/ng/location.js @@ -528,12 +528,14 @@ function $LocationProvider(){ rewrittenUrl = $location.$$rewrite(absHref); if (absHref && !elm.attr('target') && rewrittenUrl) { - // update location manually - $location.$$parse(rewrittenUrl); - $rootScope.$apply(); event.preventDefault(); - // hack to work around FF6 bug 684208 when scenario runner clicks on links - window.angular['ff-684208-preventDefault'] = true; + if (rewrittenUrl != initialUrl) { + // update location manually + $location.$$parse(rewrittenUrl); + $rootScope.$apply(); + // hack to work around FF6 bug 684208 when scenario runner clicks on links + window.angular['ff-684208-preventDefault'] = true; + } } }); |
