diff --git a/admin/themes/default/js/albums.js b/admin/themes/default/js/albums.js index 72493bdae..13cccbf04 100644 --- a/admin/themes/default/js/albums.js +++ b/admin/themes/default/js/albums.js @@ -212,6 +212,10 @@ $(document).ready(() => { // AddAlbumPopIn $(".AddAlbumErrors").hide(); $(".DeleteAlbumErrors").hide(); + $(".add-album-button").on("click", function () { + openAddAlbumPopIn(); + $(".AddAlbumSubmit").data("a-parent", 0); + }) $(".move-cat-add").on("click", function () { openAddAlbumPopIn(); $(".AddAlbumSubmit").data("a-parent", $(this).data("aid")); @@ -242,7 +246,8 @@ $(document).ready(() => { success: function (raw_data) { data = jQuery.parseJSON(raw_data); var parent_node = $('.tree').tree('getNodeById', newAlbumParent); - $('.tree').tree( + if (newAlbumPosition == "last") { + $('.tree').tree( 'appendNode', { id: data.result.id, @@ -250,7 +255,19 @@ $(document).ready(() => { name: newAlbumName }, parent_node - ); + ); + } else { + $('.tree').tree( + 'prependNode', + { + id: data.result.id, + isEmptyFolder: true, + name: newAlbumName + }, + parent_node + ); + } + $(".move-cat-add").unbind("click").on("click", function () { openAddAlbumPopIn(); diff --git a/admin/themes/default/template/albums.tpl b/admin/themes/default/template/albums.tpl index e8f6fb8cb..d3acb94e2 100644 --- a/admin/themes/default/template/albums.tpl +++ b/admin/themes/default/template/albums.tpl @@ -100,13 +100,21 @@ const has_images_recursives = '{'delete only album, not photos'|@translate|escap
-
{'Drag and drop to reorder albums'|@translate}
+
+ +
+
+ +
- {'Apply an automatic order to root albums'|@translate}
@@ -408,4 +416,27 @@ input[name="position"] { .deleteAlbumOptions input{ margin-right: 5px; } + +.album-add-button-label, .order-root-button-label { + padding: 10px; + box-shadow: 0px 2px #00000024; + border-radius: 5px; + font-weight: bold; + display: flex; + align-items: baseline; + cursor: pointer; + font-size: 13px; + background-color: #fafafa; + height: 18px; +} +.album-add-button-label p, +.order-root-button-label p { + white-space: nowrap; + margin: 0 !important; +} + +.add-album-button, +.order-root-button { + margin: 0 10px 0 0; +} \ No newline at end of file diff --git a/admin/themes/default/theme.css b/admin/themes/default/theme.css index 544eb3223..07ec2f098 100644 --- a/admin/themes/default/theme.css +++ b/admin/themes/default/theme.css @@ -2081,7 +2081,7 @@ h2:lang(en) { text-transform:capitalize; } } .pluginFilter {justify-content: end;position: absolute;right: 160px; z-index: 2; transform: translateY(6px);} -.albumsFilter { margin-right: 20px; } +.albumsFilter { margin-left: auto; } .pluginBox { display:flex; @@ -4097,15 +4097,14 @@ FORM#categoryOrdering p.albumActions .userSeparator {margin:0 5px;} /* Move Album */ .cat-move-header { display: flex; - margin: 0px 30px; + margin: 0px 20px; align-items: center; font-size: 14px; - justify-content: space-between; margin-top: 20px; } .cat-move-header .order-root::before { - font-size: 16px; + font-size: 13px; } .cat-move-header .cat-move-info {