This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 2 files changed +20
-5
lines changed
2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -528,12 +528,14 @@ function $LocationProvider(){
528
528
rewrittenUrl = $location . $$rewrite ( absHref ) ;
529
529
530
530
if ( absHref && ! elm . attr ( 'target' ) && rewrittenUrl ) {
531
- // update location manually
532
- $location . $$parse ( rewrittenUrl ) ;
533
- $rootScope . $apply ( ) ;
534
531
event . preventDefault ( ) ;
535
- // hack to work around FF6 bug 684208 when scenario runner clicks on links
536
- window . angular [ 'ff-684208-preventDefault' ] = true ;
532
+ if ( rewrittenUrl != initialUrl ) {
533
+ // update location manually
534
+ $location . $$parse ( rewrittenUrl ) ;
535
+ $rootScope . $apply ( ) ;
536
+ // hack to work around FF6 bug 684208 when scenario runner clicks on links
537
+ window . angular [ 'ff-684208-preventDefault' ] = true ;
538
+ }
537
539
}
538
540
} ) ;
539
541
Original file line number Diff line number Diff line change @@ -819,6 +819,19 @@ describe('$location', function() {
819
819
} ) ;
820
820
821
821
822
+ it ( 'should do nothing if already on the same URL' , function ( ) {
823
+ configureService ( '/base/' , true , true ) ;
824
+ inject (
825
+ initBrowser ( ) ,
826
+ initLocation ( ) ,
827
+ function ( $browser ) {
828
+ browserTrigger ( link , 'click' ) ;
829
+ expectNoRewrite ( $browser , 'http://host.com/base/' ) ;
830
+ }
831
+ ) ;
832
+ } ) ;
833
+
834
+
822
835
it ( 'should rewrite abs link to new url when history enabled on new browser' , function ( ) {
823
836
configureService ( '/base/link?a#b' , true , true ) ;
824
837
inject (
You can’t perform that action at this time.
0 commit comments