chg: [UI] Move `.sightings_advanced_add` handler to misp.js

pull/8327/head
Jakub Onderka 2022-05-05 17:14:26 +02:00
parent 11d41c01d1
commit 34e17d276c
3 changed files with 14 additions and 28 deletions

View File

@ -321,21 +321,6 @@ echo $this->element('/genericElements/SideMenu/side_menu', ['menuList' => 'event
hide: 100
}
});
$('.sightings_advanced_add').click(function() {
var selected = [];
var object_context = $(this).data('object-context');
var object_id = $(this).data('object-id');
if (object_id == 'selected') {
$(".select_attribute").each(function() {
if ($(this).is(":checked")) {
selected.push($(this).data("id"));
}
});
object_id = selected.join('|');
}
url = "<?php echo $baseurl; ?>" + "/sightings/advanced/" + object_id + "/" + object_context;
genericPopup(url, '#popover_box');
});
popoverStartup();
$(document).on('click', function(e) {
//did not click a popover toggle or popover

View File

@ -232,19 +232,6 @@ attributes or the appropriate distribution level. If you think there is a mistak
attributeListAnyAttributeCheckBoxesChecked();
attributeListAnyProposalCheckBoxesChecked();
});
$('.sightings_advanced_add').click(function() {
var selected = [];
var object_context = $(this).data('object-context');
var object_id = $(this).data('object-id');
if (object_id === 'selected') {
$(".select_attribute:checked").each(function() {
selected.push($(this).data("id"));
});
object_id = selected.join('|');
}
var url = "<?php echo $baseurl; ?>" + "/sightings/advanced/" + object_id + "/" + object_context;
genericPopup(url, '#popover_box');
});
});
$('.searchFilterButton, #quickFilterButton').click(function() {
filterAttributes('value');

View File

@ -657,6 +657,20 @@ function submitForm($td, type, id, field) {
var field = $(this).data('edit-field');
quickEditHover(this, type, objectId, field);
});
// Show popover with advanced sigtings information about given or selected attributes
$(document.body).on('click', '.sightings_advanced_add', function() {
var object_context = $(this).data('object-context');
var object_id = $(this).data('object-id');
if (object_id === 'selected') {
var selected = [];
$(".select_attribute:checked").each(function() {
selected.push($(this).data("id"));
});
object_id = selected.join('|');
}
var url = baseurl + "/sightings/advanced/" + object_id + "/" + object_context;
genericPopup(url, '#popover_box');
});
})();
function quickSubmitTagForm(selected_tag_ids, addData) {