Merge pull request #3723 from Icinga/feature/ctrl-click-does-not-open-links-in-new-tab-3722
Make ctrl-click open new tab
This commit is contained in:
commit
b4979b75a9
|
@ -95,6 +95,11 @@
|
||||||
var _this = event.data.self;
|
var _this = event.data.self;
|
||||||
var icinga = _this.icinga;
|
var icinga = _this.icinga;
|
||||||
|
|
||||||
|
// Check for ctrl or cmd click to open new tab and don't unfold other menus
|
||||||
|
if (event.ctrlKey || event.metaKey) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (href.match(/#/)) {
|
if (href.match(/#/)) {
|
||||||
// ...it may be a menu section without a dedicated link.
|
// ...it may be a menu section without a dedicated link.
|
||||||
// Switch the active menu item:
|
// Switch the active menu item:
|
||||||
|
|
|
@ -457,10 +457,16 @@
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for ctrl or cmd click to open new tab unless clicking on a multiselect row
|
||||||
|
if ((event.ctrlKey || event.metaKey) && href !== '#' && $a.is('a')) {
|
||||||
|
window.open(href, linkTarget);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Special checks for link clicks in action tables
|
// Special checks for link clicks in action tables
|
||||||
if (! $a.is('tr[href]') && $a.closest('table.action').length > 0) {
|
if (! $a.is('tr[href]') && $a.closest('table.action').length > 0) {
|
||||||
|
|
||||||
// ignoray clicks to ANY link with special key pressed
|
// ignore clicks to ANY link with special key pressed
|
||||||
if ($a.closest('table.multiselect').length > 0 && (event.ctrlKey || event.metaKey || event.shiftKey)) {
|
if ($a.closest('table.multiselect').length > 0 && (event.ctrlKey || event.metaKey || event.shiftKey)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue