From a593ceffda21a7147f34773e649b09944cac9e7d Mon Sep 17 00:00:00 2001 From: Samuell Date: Wed, 29 Jan 2020 20:31:19 +0100 Subject: [PATCH] Use middle mouse click to open list row in new window (#4917) --- modules/system/assets/ui/js/list.rowlink.js | 6 +++++- modules/system/assets/ui/storm-min.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/system/assets/ui/js/list.rowlink.js b/modules/system/assets/ui/js/list.rowlink.js index bd06ab356..43cabb5ce 100644 --- a/modules/system/assets/ui/js/list.rowlink.js +++ b/modules/system/assets/ui/js/list.rowlink.js @@ -62,8 +62,12 @@ } } - $(this).not('.' + options.excludeClass).find('td').not('.' + options.excludeClass).click(function(e) { + $(this).not('.' + options.excludeClass).find('td').not('.' + options.excludeClass).click(function (e) { handleClick(e) + }).mousedown(function (e) { + if (e.which == 2) { + window.open(href) + } }) $(this).not('.' + options.excludeClass).on('keypress', function(e) { diff --git a/modules/system/assets/ui/storm-min.js b/modules/system/assets/ui/storm-min.js index 021eec3d0..3a7882da2 100644 --- a/modules/system/assets/ui/storm-min.js +++ b/modules/system/assets/ui/storm-min.js @@ -4074,7 +4074,7 @@ else if(request){link.request()} else if(popup){link.popup()} else if(e.ctrlKey||e.metaKey){window.open(href)} else{window.location=href}} -$(this).not('.'+options.excludeClass).find('td').not('.'+options.excludeClass).click(function(e){handleClick(e)}) +$(this).not('.'+options.excludeClass).find('td').not('.'+options.excludeClass).click(function(e){handleClick(e)}).mousedown(function(e){if(e.which==2){window.open(href)}}) $(this).not('.'+options.excludeClass).on('keypress',function(e){if(e.key==='(Space character)'||e.key==='Spacebar'||e.key===' '){handleClick(e) return false}}) $(this).addClass(options.linkedClass)