mirror of https://github.com/MISP/MISP
fix: [js] Various fixes with adding/removing tags
parent
6f8e03c657
commit
856a76951f
|
@ -619,6 +619,7 @@ function quickSubmitTagCollectionTagForm(tag_collection_id, tag_id) {
|
||||||
},
|
},
|
||||||
success:function (data, textStatus) {
|
success:function (data, textStatus) {
|
||||||
handleGenericAjaxResponse(data);
|
handleGenericAjaxResponse(data);
|
||||||
|
refreshTagCollectionRow(tag_collection_id);
|
||||||
},
|
},
|
||||||
error:function() {
|
error:function() {
|
||||||
showMessage('fail', 'Could not add tag.');
|
showMessage('fail', 'Could not add tag.');
|
||||||
|
@ -635,6 +636,20 @@ function quickSubmitTagCollectionTagForm(tag_collection_id, tag_id) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function refreshTagCollectionRow(tag_collection_id) {
|
||||||
|
$.ajax({
|
||||||
|
type:"get",
|
||||||
|
url:"/tag_collections/getRow/" + tag_collection_id,
|
||||||
|
error:function() {
|
||||||
|
showMessage('fail', 'Could not fetch updates to the modified row.');
|
||||||
|
},
|
||||||
|
success: function (data, textStatus) {
|
||||||
|
$('[data-row-id="' + tag_collection_id + '"]').replaceWith(data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function handleAjaxEditResponse(data, name, type, id, field, event) {
|
function handleAjaxEditResponse(data, name, type, id, field, event) {
|
||||||
responseArray = data;
|
responseArray = data;
|
||||||
if (type == 'Attribute') {
|
if (type == 'Attribute') {
|
||||||
|
@ -934,8 +949,8 @@ function removeObjectTag(context, object, tag) {
|
||||||
$("#gray_out").fadeOut();
|
$("#gray_out").fadeOut();
|
||||||
if (context == 'Attribute') {
|
if (context == 'Attribute') {
|
||||||
loadAttributeTags(object);
|
loadAttributeTags(object);
|
||||||
} else if (context == 'TagCollection') {
|
} else if (context == 'tag_collection') {
|
||||||
|
refreshTagCollectionRow(object);
|
||||||
} else {
|
} else {
|
||||||
loadEventTags(object);
|
loadEventTags(object);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue