js: Fix that buttons with any DOM descendants are not ignored by linkClicked

fixes #8380
This commit is contained in:
Johannes Meyer 2015-02-16 15:07:31 +01:00
parent 43691f6612
commit 0c0478688e
1 changed files with 12 additions and 3 deletions

View File

@ -364,6 +364,7 @@
var self = event.data.self;
var icinga = self.icinga;
var $a = $(this);
var $eventTarget = $(event.target);
var href = $a.attr('href');
var linkTarget = $a.attr('target');
var $target;
@ -400,9 +401,17 @@
return false;
}
// Ignore form elements in action rows
if ($(event.target).is('input') || $(event.target).is('button')) {
return;
if (! $eventTarget.is($a)) {
if ($eventTarget.is('input') || $eventTarget.is('button')) {
// Ignore form elements in action rows
return;
} else {
var $button = $('input[type=submit]:focus').add('button[type=submit]:focus');
if ($button.length > 0 && $.contains($button[0], $eventTarget[0])) {
// Ignore any descendant of form elements
return;
}
}
}
// ignore multiselect table row clicks