From 279007a754eed20453e026de7d4795a6ad326643 Mon Sep 17 00:00:00 2001 From: corentin-soriano Date: Thu, 19 Sep 2024 14:39:48 +0200 Subject: [PATCH] Select the new jstree folder on item copy/move. --- pages/items.js.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pages/items.js.php b/pages/items.js.php index ff3252f23..c25d5d95f 100755 --- a/pages/items.js.php +++ b/pages/items.js.php @@ -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 @@ -1611,7 +1616,7 @@ function(data) { ); // Close - $('#folder-tree-container').removeClass('hidden'); + $('#folders-tree-card').removeClass('hidden'); $('.form-item-copy').addClass('hidden'); } else { // ERROR @@ -3220,6 +3225,11 @@ function(data) { key: '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;