mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
Related to #1607 Fix multi http calls on tag rename
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user