Skip to content

Commit

Permalink
action-list.js: Fix double loading of real links
Browse files Browse the repository at this point in the history
  • Loading branch information
lippserd committed Mar 13, 2020
1 parent 6bdf32c commit 9f8815d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions public/js/action-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]')) {
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 9f8815d

Please sign in to comment.