This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -528,12 +528,14 @@ function $LocationProvider(){
528528 rewrittenUrl = $location . $$rewrite ( absHref ) ;
529529
530530 if ( absHref && ! elm . attr ( 'target' ) && rewrittenUrl ) {
531- // update location manually
532- $location . $$parse ( rewrittenUrl ) ;
533- $rootScope . $apply ( ) ;
534531 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+ }
537539 }
538540 } ) ;
539541
Original file line number Diff line number Diff line change @@ -819,6 +819,19 @@ describe('$location', function() {
819819 } ) ;
820820
821821
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+
822835 it ( 'should rewrite abs link to new url when history enabled on new browser' , function ( ) {
823836 configureService ( '/base/link?a#b' , true , true ) ;
824837 inject (
You can’t perform that action at this time.
0 commit comments