From 9f8815d5805bbbc92a4a6f539d70bd90f10009d4 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 13 Mar 2020 16:02:14 +0100 Subject: [PATCH] action-list.js: Fix double loading of real links --- public/js/action-list.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/js/action-list.js b/public/js/action-list.js index 05fc5abb7..c35f9616e 100644 --- a/public/js/action-list.js +++ b/public/js/action-list.js @@ -40,15 +40,17 @@ ActionList.prototype.onClick = function (event) { var _this = event.data.self; var $activeItems; - var $item = $(this).closest('.list-item'); + var $target = $(this); + var $item = $target.closest('.list-item'); var $list = $item.parent('.action-list'); - if ($(event.target).closest('[data-no-icinga-ajax]').length > 0) { + if ($target.closest('[data-no-icinga-ajax]').length > 0) { // Quickfix? Interferes with loadmore.js otherwise return true; } event.preventDefault(); + event.stopImmediatePropagation(); event.stopPropagation(); if ($list.is('[data-icinga-multiselect-url]')) { @@ -93,7 +95,7 @@ var url; if ($activeItems.length === 1) { - url = $item.find('[href]').first().attr('href'); + url = $target.is('a') ? $target.attr('href') : $item.find('[href]').first().attr('href'); } else { var filters = $activeItems.map(function () { return $(this).attr('data-icinga-multiselect-filter');