From 2ceb5b7d54e4b66880a4ce27e586b99215fd0fe6 Mon Sep 17 00:00:00 2001 From: Matthieu Leproux Date: Mon, 11 Apr 2022 11:59:17 +0200 Subject: [PATCH] related to #1609 album name in input rename Also solved listenner bug when moving albums to root --- admin/themes/default/js/albums.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/admin/themes/default/js/albums.js b/admin/themes/default/js/albums.js index b9b6054fd..b60f627c7 100644 --- a/admin/themes/default/js/albums.js +++ b/admin/themes/default/js/albums.js @@ -417,7 +417,7 @@ function closeAddAlbumPopIn() { function openRenameAlbumPopIn(replacedAlbumName) { $("#RenameAlbum").fadeIn(); $(".RenameAlbumTitle span").html(rename_item.replace("%s", replacedAlbumName)) - $(".RenameAlbumLabelUsername .user-property-input").val(''); + $(".RenameAlbumLabelUsername .user-property-input").val(replacedAlbumName); $(".RenameAlbumLabelUsername .user-property-input").focus(); } function closeRenameAlbumPopIn() { @@ -635,7 +635,20 @@ function applyMove(event) { $(".RenameAlbumSubmit").data("cat_id", $(this).attr('data-id')); }); }) - .catch((message) => console.log('An error has occured : ' + message )); + .catch(function (message) { + console.log('An error has occured : ' + message ); + $(".move-cat-add").unbind("click").on("click", function () { + openAddAlbumPopIn(); + $(".AddAlbumSubmit").data("a-parent", $(this).data("aid")); + }); + $(".move-cat-delete").on("click", function () { + triggerDeleteAlbum($(this).data("id")); + }); + $(".move-cat-title-container").on("click", function () { + openRenameAlbumPopIn($(this).find(".move-cat-title").attr("title")); + $(".RenameAlbumSubmit").data("cat_id", $(this).attr('data-id')); + }); + }) } function moveNode(node, rank, parent) {