fix: [eventReports:markdownEditor] Force close the popover if parent

element not found
pull/6412/head
mokaddem 2020-10-09 14:43:10 +02:00
parent fcca50bf05
commit a8c7503b52
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 5 additions and 1 deletions

View File

@ -845,7 +845,11 @@ function closeThePopover(closeButton) {
var scope = $(closeButton).data('scope')
var elementID = $(closeButton).data('elementid')
var $MISPElement = $('[data-scope="' + scope + '"][data-elementid="' + elementID.replaceAll('\"', '\\\"') + '"]')
$MISPElement.popover('hide');
if ($MISPElement) {
$MISPElement.popover('hide');
} else {
$(closeButton).closest('.popover').remove()
}
}
function constructAttributeRow(attribute, fromObject)