Added rename validation when "Enter" is pressed, and tiptip working when create/move album

This commit is contained in:
Matthieu Leproux
2022-05-10 12:47:21 +02:00
parent 6956d590d9
commit 64048bd3ec
+26
View File
@@ -394,6 +394,11 @@ $(document).ready(() => {
openRenameAlbumPopIn($(this).find(".move-cat-title").attr("title"));
$(".RenameAlbumSubmit").data("cat_id", $(this).attr('data-id'));
});
$('.tiptip').tipTip({
delay: 0,
fadeIn: 200,
fadeOut: 200
});
updateTitleBadge(nb_albums+1)
@@ -470,6 +475,12 @@ function openRenameAlbumPopIn(replacedAlbumName) {
$(".RenameAlbumTitle span").html(rename_item.replace("%s", replacedAlbumName))
$(".RenameAlbumLabelUsername .user-property-input").val(replacedAlbumName);
$(".RenameAlbumLabelUsername .user-property-input").focus();
$(document).unbind("keypress").on('keypress',function(e) {
if(e.which == 13) {
$(".RenameAlbumSubmit").trigger("click");
}
});
}
function closeRenameAlbumPopIn() {
$("#RenameAlbum").fadeOut();
@@ -551,6 +562,11 @@ function openDeleteAlbumPopIn(cat_to_delete) {
openRenameAlbumPopIn($(this).find(".move-cat-title").attr("title"));
$(".RenameAlbumSubmit").data("cat_id", $(this).attr('data-id'));
});
$('.tiptip').tipTip({
delay: 0,
fadeIn: 200,
fadeOut: 200
});
updateTitleBadge(nb_albums-1);
setSubcatsBadge(parentOfDeletedNode);
@@ -709,6 +725,11 @@ function applyMove(event) {
openRenameAlbumPopIn($(this).find(".move-cat-title").attr("title"));
$(".RenameAlbumSubmit").data("cat_id", $(this).attr('data-id'));
});
$('.tiptip').tipTip({
delay: 0,
fadeIn: 200,
fadeOut: 200
});
})
.catch(function (message) {
console.log('An error has occured : ' + message );
@@ -730,6 +751,11 @@ function applyMove(event) {
openRenameAlbumPopIn($(this).find(".move-cat-title").attr("title"));
$(".RenameAlbumSubmit").data("cat_id", $(this).attr('data-id'));
});
$('.tiptip').tipTip({
delay: 0,
fadeIn: 200,
fadeOut: 200
});
})
}