This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -837,7 +837,7 @@ function $LocationProvider() {
837
837
// TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)
838
838
// currently we open nice url link and redirect then
839
839
840
- if ( ! html5Mode . rewriteLinks || event . ctrlKey || event . metaKey || event . which == 2 ) return ;
840
+ if ( ! html5Mode . rewriteLinks || event . ctrlKey || event . metaKey || event . shiftKey || event . which == 2 || event . button == 2 ) return ;
841
841
842
842
var elm = jqLite ( event . target ) ;
843
843
Original file line number Diff line number Diff line change @@ -1505,6 +1505,19 @@ describe('$location', function() {
1505
1505
} ) ;
1506
1506
1507
1507
1508
+ it ( 'should not rewrite when clicked with shift pressed' , function ( ) {
1509
+ configureService ( { linkHref : 'base/a?b=c' , html5Mode : true , supportHist : true } ) ;
1510
+ inject (
1511
+ initBrowser ( ) ,
1512
+ initLocation ( ) ,
1513
+ function ( $browser ) {
1514
+ browserTrigger ( link , 'click' , { keys : [ 'shift' ] } ) ;
1515
+ expectNoRewrite ( $browser ) ;
1516
+ }
1517
+ ) ;
1518
+ } ) ;
1519
+
1520
+
1508
1521
it ( 'should not mess up hash urls when clicking on links in hashbang mode' , function ( ) {
1509
1522
var base ;
1510
1523
module ( function ( ) {
You can’t perform that action at this time.
0 commit comments