Skip to content

Commit

Permalink
Select the new jstree folder on item copy/move.
Browse files Browse the repository at this point in the history
  • Loading branch information
corentin-soriano committed Sep 19, 2024
1 parent 174cfb9 commit 279007a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pages/items.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,11 @@ function(data) {
timeOut: 1000
}
);

// Select folder of new item in jstree
$('#jstree').jstree('deselect_all');
$('#jstree').jstree('select_node', '#li_' + $('#form-item-copy-destination').val());

// Refresh tree
refreshTree(parseInt($('#form-item-copy-destination').val()), true);
// Load list of items
Expand All @@ -1611,7 +1616,7 @@ function(data) {
);

// Close
$('#folder-tree-container').removeClass('hidden');
$('#folders-tree-card').removeClass('hidden');
$('.form-item-copy').addClass('hidden');
} else {
// ERROR
Expand Down Expand Up @@ -3220,6 +3225,11 @@ function(data) {
key: '<?php echo $session->get('key'); ?>'
}
);

// Select new folder of item in jstree
$('#jstree').jstree('deselect_all');
$('#jstree').jstree('select_node', '#li_' + $('#form-item-folder').val());

} else if ($('#form-item-button-save').data('action') === 'new_item') {
window.location.href = './index.php?page=items&group='+$('#form-item-folder').val()+'&id='+data.item_id;
return;
Expand Down

0 comments on commit 279007a

Please sign in to comment.