mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-26 19:29:58 +03:00
fixed #1781 better UX for the add album popin
This commit is contained in:
parent
7f00155ca7
commit
532fc743f2
5 changed files with 94 additions and 73 deletions
|
@ -345,6 +345,8 @@ $(document).ready(() => {
|
||||||
success: function (raw_data) {
|
success: function (raw_data) {
|
||||||
data = jQuery.parseJSON(raw_data);
|
data = jQuery.parseJSON(raw_data);
|
||||||
var parent_node = $('.tree').tree('getNodeById', newAlbumParent);
|
var parent_node = $('.tree').tree('getNodeById', newAlbumParent);
|
||||||
|
|
||||||
|
if (data.stat == "ok") {
|
||||||
if (newAlbumPosition == "last") {
|
if (newAlbumPosition == "last") {
|
||||||
$('.tree').tree(
|
$('.tree').tree(
|
||||||
'appendNode',
|
'appendNode',
|
||||||
|
@ -417,13 +419,17 @@ $(document).ready(() => {
|
||||||
$('html,body').animate({
|
$('html,body').animate({
|
||||||
scrollTop: $("#cat-" + data.result.id).offset().top - screen.height / 2},
|
scrollTop: $("#cat-" + data.result.id).offset().top - screen.height / 2},
|
||||||
'slow');
|
'slow');
|
||||||
|
|
||||||
|
closeAddAlbumPopIn();
|
||||||
|
$(".AddAlbumSubmit").removeClass("notClickable");
|
||||||
|
} else {
|
||||||
|
$(".AddAlbumErrors").text(str_album_name_empty).show();
|
||||||
|
$(".AddAlbumSubmit").removeClass("notClickable");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: function(message) {
|
error: function(message) {
|
||||||
console.log(message);
|
console.log(message);
|
||||||
}
|
}
|
||||||
}).done(function () {
|
|
||||||
closeAddAlbumPopIn();
|
|
||||||
$(".AddAlbumSubmit").removeClass("notClickable");
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -477,6 +483,17 @@ function openAddAlbumPopIn(parentAlbumId) {
|
||||||
$("#AddAlbum").fadeIn();
|
$("#AddAlbum").fadeIn();
|
||||||
$(".AddAlbumLabelUsername .user-property-input").val('');
|
$(".AddAlbumLabelUsername .user-property-input").val('');
|
||||||
$(".AddAlbumLabelUsername .user-property-input").focus();
|
$(".AddAlbumLabelUsername .user-property-input").focus();
|
||||||
|
|
||||||
|
$("#AddAlbum").on('keyup', function (e) {
|
||||||
|
// 13 is 'Enter'
|
||||||
|
if(e.keyCode === 13) {
|
||||||
|
$(".AddAlbumSubmit").trigger("click");
|
||||||
|
}
|
||||||
|
// 27 is 'Escape'
|
||||||
|
if(e.keyCode === 27) {
|
||||||
|
closeAddAlbumPopIn();
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
function closeAddAlbumPopIn() {
|
function closeAddAlbumPopIn() {
|
||||||
$("#AddAlbum").fadeOut();
|
$("#AddAlbum").fadeOut();
|
||||||
|
|
|
@ -38,7 +38,8 @@ const str_add_photo = '{'Add Photos'|@translate|escape:javascript}';
|
||||||
const str_visit_gallery = '{'Visit Gallery'|@translate|escape:javascript}';
|
const str_visit_gallery = '{'Visit Gallery'|@translate|escape:javascript}';
|
||||||
const str_sort_order = '{'Automatic sort order'|@translate|escape:javascript}';
|
const str_sort_order = '{'Automatic sort order'|@translate|escape:javascript}';
|
||||||
const str_delete_album = '{'Delete album'|@translate|escape:javascript}';
|
const str_delete_album = '{'Delete album'|@translate|escape:javascript}';
|
||||||
const str_root_order = '{'Apply to root albums'|@translate|escape:javascript}'
|
const str_root_order = '{'Apply to root albums'|@translate|escape:javascript}';
|
||||||
|
str_album_name_empty = '{'Album name must not be empty'|@translate|escape:javascript}'
|
||||||
|
|
||||||
const add_album_root_title = '{'Create a new album at root'|@translate|escape:javascript}';
|
const add_album_root_title = '{'Create a new album at root'|@translate|escape:javascript}';
|
||||||
const add_sub_album_of = '{'Create a sub-album of "%s"'|@translate|escape:javascript}';
|
const add_sub_album_of = '{'Create a sub-album of "%s"'|@translate|escape:javascript}';
|
||||||
|
|
|
@ -1323,4 +1323,5 @@ $lang['Always have a backup of your database and files.'] = 'Always have a backu
|
||||||
$lang['The best is to have them made automatically on a regular basis.'] = 'The best is to have them made automatically on a regular basis.';
|
$lang['The best is to have them made automatically on a regular basis.'] = 'The best is to have them made automatically on a regular basis.';
|
||||||
$lang['If anything bad happens during the update, you would be able to restore a backup.'] = 'If anything bad happens during the update, you would be able to restore a backup.';
|
$lang['If anything bad happens during the update, you would be able to restore a backup.'] = 'If anything bad happens during the update, you would be able to restore a backup.';
|
||||||
$lang['Apply to root albums'] = 'Apply to root albums';
|
$lang['Apply to root albums'] = 'Apply to root albums';
|
||||||
|
$lang['Album name must not be empty'] = 'Album name must not be empty';
|
||||||
// Leave this line empty
|
// Leave this line empty
|
||||||
|
|
|
@ -1323,4 +1323,5 @@ $lang['Always have a backup of your database and files.'] = 'Ayez toujours une s
|
||||||
$lang['The best is to have them made automatically on a regular basis.'] = 'Le mieux est de le faire automatiquement et régulièrement';
|
$lang['The best is to have them made automatically on a regular basis.'] = 'Le mieux est de le faire automatiquement et régulièrement';
|
||||||
$lang['If anything bad happens during the update, you would be able to restore a backup.'] = 'Si quelque chose arrive pendant la mise à jour, il sera possible de restaurer la sauvegarde';
|
$lang['If anything bad happens during the update, you would be able to restore a backup.'] = 'Si quelque chose arrive pendant la mise à jour, il sera possible de restaurer la sauvegarde';
|
||||||
$lang['Apply to root albums'] = 'Appliquer aux albums racine';
|
$lang['Apply to root albums'] = 'Appliquer aux albums racine';
|
||||||
|
$lang['Album name must not be empty'] = 'Le nom de l\'album ne doit pas être vide';
|
||||||
// Leave this line empty
|
// Leave this line empty
|
||||||
|
|
|
@ -93,6 +93,7 @@ $(() => {
|
||||||
url: ws_url,
|
url: ws_url,
|
||||||
data: { format: "json", method: "reflection.getMethodList" }
|
data: { format: "json", method: "reflection.getMethodList" }
|
||||||
}).done(function (result) {
|
}).done(function (result) {
|
||||||
|
console.log(result);
|
||||||
result = parsePwgJSON(result);
|
result = parsePwgJSON(result);
|
||||||
|
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue