mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-06 08:43:31 +02:00
fixes #1451 Can now open move album from album manager
This commit is contained in:
@@ -324,6 +324,7 @@ foreach ($categories as $category)
|
||||
'U_CHILDREN' => $cat_list_url.'&parent_id='.$category['id'],
|
||||
'U_EDIT' => $base_url.'album-'.$category['id'],
|
||||
'U_ADD_PHOTOS_ALBUM' => $base_url.'photos_add&album='.$category['id'],
|
||||
'U_MOVE' => $base_url.'cat_move#cat-'.$category['id'],
|
||||
|
||||
'IS_VIRTUAL' => empty($category['dir'])
|
||||
);
|
||||
|
||||
@@ -288,6 +288,7 @@ $template->assign(
|
||||
'U_ADD_PHOTOS_ALBUM' => $base_url.'photos_add&album='.$category['id'],
|
||||
'U_CHILDREN' => $cat_list_url.'&parent_id='.$category['id'],
|
||||
'U_HELP' => get_root_url().'admin/popuphelp.php?page=cat_modify',
|
||||
'U_MOVE' => $base_url.'cat_move#cat-'.$category['id'],
|
||||
|
||||
'F_ACTION' => $form_action,
|
||||
)
|
||||
|
||||
@@ -63,6 +63,13 @@ $(document).ready(() => {
|
||||
cont.find(".icon-folder-open, .icon-sitemap").addClass(colors[colorId]);
|
||||
}
|
||||
|
||||
var url_split = window.location.href.split("&");
|
||||
var catToOpen = url_split[url_split.length-1].split("-")[1];
|
||||
|
||||
if(catToOpen) {
|
||||
goToNode($('.tree').tree('getNodeById', catToOpen), $('.tree').tree('getNodeById', catToOpen));
|
||||
}
|
||||
|
||||
$('.tree').on( 'click', '.move-cat-toogler', function(e) {
|
||||
var node_id = $(this).attr('data-id');
|
||||
var node = $('.tree').tree('getNodeById', node_id);
|
||||
@@ -157,6 +164,18 @@ $(document).ready(() => {
|
||||
}
|
||||
});
|
||||
|
||||
function goToNode(node, firstNode) {
|
||||
if (node.parent) {
|
||||
goToNode(node.parent, firstNode);
|
||||
if(node != firstNode) {
|
||||
$(".tree").tree('openNode', node);
|
||||
}
|
||||
} else {
|
||||
$(".tree").tree('openNode', node);
|
||||
$("#cat-"+firstNode.id).addClass("animateFocus");
|
||||
}
|
||||
}
|
||||
|
||||
function getId(parent) {
|
||||
if (parent.getLevel() == 0) {
|
||||
return 0;
|
||||
|
||||
@@ -56,6 +56,7 @@ jQuery(document).ready(function(){
|
||||
<div class="albumActions">
|
||||
<a href="{$category.U_EDIT}" class="actionEdit" {*title="{'Edit'|@translate}"*}><span class="icon-pencil tiptip" title="{'Edit'|@translate}"></span><span class="iconLegend">{'Edit'|@translate}</span></a>
|
||||
<a href="{$category.U_CHILDREN}" class="actionTitle" {*title="{'sub-albums'|@translate}"*}><span class="icon-sitemap tiptip" title="{'sub-albums'|@translate}"></span><span class="iconLegend">{'sub-albums'|@translate}</span></a>
|
||||
<a href="{$category.U_MOVE}" class="actionMove"><span class="icon-move tiptip" title="{'Move'|@translate}"></span><span class="iconLegend">{'Move'|@translate}</span></a>
|
||||
{if cat_admin_access($category.ID)}
|
||||
<a href="{$category.U_JUMPTO}" class="actionGalery" {*title="{'Visit Gallery'|@translate}"*}><span class="icon-eye tiptip" title="{'Visit Gallery'|@translate}"></span><span class="iconLegend">{'Visit Gallery'|@translate}</span></a>
|
||||
{else}
|
||||
|
||||
@@ -262,6 +262,10 @@ function cropImage() {
|
||||
<a class="icon-exchange" href="{$U_SYNC}">{'Synchronize'|@translate}</a>
|
||||
{/if}
|
||||
|
||||
{if isset($U_MOVE) }
|
||||
<a class="icon-move moveAlbum" href="{$U_MOVE}">{'Move'|@translate}</a>
|
||||
{/if}
|
||||
|
||||
{if isset($U_DELETE) }
|
||||
<a class="icon-trash deleteAlbum" href="#">{'Delete album'|@translate}</a>
|
||||
{/if}
|
||||
|
||||
@@ -84,4 +84,44 @@ var delay_autoOpen = {$delay_before_autoOpen}
|
||||
<a class="order-root icon-sitemap"> {'Apply an automatic order to root albums'|@translate} </a>
|
||||
</div>
|
||||
|
||||
<div class='tree'> </div>
|
||||
<div class='tree'> </div>
|
||||
|
||||
<style>
|
||||
|
||||
.animateFocus {
|
||||
position: relative;
|
||||
border-left: 4px solid #ff7700;
|
||||
}
|
||||
|
||||
.animateFocus .icon-grip-vertical-solid {
|
||||
color: #ff7700;
|
||||
}
|
||||
|
||||
.animateFocus:before {
|
||||
content: '';
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position:absolute;
|
||||
top:50%;
|
||||
left:50%;
|
||||
transform: translate(-50%,-50%);
|
||||
animation: ripples .8s ease-out 0.3s ;
|
||||
opacity: 0;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.jqtree_element {
|
||||
transition: 1s;
|
||||
}
|
||||
|
||||
@keyframes ripples {
|
||||
0% {
|
||||
border: 0px solid #ff7700;
|
||||
opacity: 0.7;
|
||||
}
|
||||
100% {
|
||||
border: 20px solid #ff7700;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user