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

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);
}

View File

@@ -169,6 +169,10 @@ var str_tag_found = '{'<b>%d</b> tag found'|@translate}';
<span>{'Rename Tag'|@translate}</span>
</div>
<div class="TagLoading">
<i class='icon-spin6 animate-spin'></i>
</div>
<div class="TagCancel">
<span>{'Cancel'|@translate}</span>
</div>

View File

@@ -3179,7 +3179,7 @@ a#showPermissions:hover {text-decoration: none;}
justify-content: space-between;
}
.TagSubmit {
.TagSubmit, .TagLoading {
cursor:pointer;
font-weight:bold;
color: #3F3E40;
@@ -3189,6 +3189,10 @@ a#showPermissions:hover {text-decoration: none;}
margin-bottom:0;
margin: 0 15px;
}
.TagLoading{
cursor: auto;
display: none;
}
.TagCancel {
cursor:pointer;
cursor: pointer;