Related to #1607 Fix multi http calls on tag rename

This commit is contained in:
Zacharie Guet
2022-02-16 11:00:18 +01:00
committed by plegall
parent 05903ffd28
commit 8c8c19e3e6
3 changed files with 24 additions and 9 deletions
+15 -8
View File
@@ -105,6 +105,21 @@ $('.tag-box').each(function() {
setupTagbox($(this))
})
//Call the API when rename a tag
$(".TagSubmit").on('click', function () {
$('.TagSubmit').hide();
$('.TagLoading').show();
renameTag($(".RenameTagPopInContainer").find(".tag-property-input").attr("id"), $(".RenameTagPopInContainer").find(".tag-property-input").val()).then(() => {
$('.TagSubmit').show();
$('.TagLoading').hide();
rename_tag_close();
}).catch((message) => {
$('.TagSubmit').show();
$('.TagLoading').hide();
console.error(message)
})
});
/*-------
Add a tag
-------*/
@@ -251,14 +266,6 @@ function set_up_popin(id, tagName) {
$(".ClosePopIn").on('click', function () {
rename_tag_close()
});
$(".TagSubmit").on('click', function () {
renameTag($(".RenameTagPopInContainer").find(".tag-property-input").attr("id"), $(".RenameTagPopInContainer").find(".tag-property-input").val()).then(() => {
console.log("then");
rename_tag_close();
}).catch((message) => {
console.log(message);
})
});
$(".TagSubmit").html(str_yes_rename_confirmation);
$(".RenameTagPopInContainer").find(".tag-property-input").val(tagName);
}