drag color

main
Satur@it-depot.ru 2025-03-06 15:23:58 +03:00
parent ae6dcee956
commit e8c32e0b62
1 changed files with 34 additions and 3 deletions

View File

@ -83,6 +83,15 @@
transform: translateY(-50%);
margin-left: 0;
}
/* Стили для подсветки папки при перетаскивании */
.jstree-node.highlight {
background-color: #d4edda !important; /* Светлая тема */
border: 2px dashed #28a745;
}
.jstree-node.highlight.dark-theme {
background-color: #2f4f4f !important; /* Темная тема */
border: 2px dashed #5cb85c;
}
.jstree-default-dark .jstree-clicked {
background: #005580 !important;
color: #e0e0e0 !important;
@ -498,6 +507,28 @@
const movedNode = data.node;
const newParentId = movedNode.parent === '#' ? null : movedNode.parent;
saveFolderPosition(movedNode.id, newParentId);
}).on('dragover.jstree', function (e) {
e.preventDefault();
const node = $(e.target).closest('.jstree-node');
if (node.length) {
node.addClass('highlight').addClass(document.body.classList.contains('dark-theme') ? 'dark-theme' : '');
}
}).on('dragenter.jstree', function (e) {
e.preventDefault();
const node = $(e.target).closest('.jstree-node');
if (node.length) {
node.addClass('highlight').addClass(document.body.classList.contains('dark-theme') ? 'dark-theme' : '');
}
}).on('dragleave.jstree', function (e) {
const node = $(e.target).closest('.jstree-node');
if (node.length) {
node.removeClass('highlight');
}
}).on('drop.jstree', function (e) {
const node = $(e.target).closest('.jstree-node');
if (node.length) {
node.removeClass('highlight');
}
});
$('#search-input').on('input', function () {
@ -746,7 +777,7 @@
}
const install = allInstalls.find(i => i.id === installId);
if (install) {
data['protocol'] = install.protocol; // Сохраняем текущий protocol
data['protocol'] = install.protocol;
}
$.ajax({
url: `${API_URL}/install/${installId}`,
@ -792,7 +823,7 @@
contentType: 'application/json',
data: JSON.stringify({
folder_id: folderId,
protocol: install.protocol // Добавляем текущее значение protocol
protocol: install.protocol
}),
success: function () {
console.log('Move successful');
@ -857,7 +888,7 @@
contentType: 'application/json',
data: JSON.stringify({
note: note,
protocol: install.protocol // Сохраняем текущий protocol
protocol: install.protocol
}),
success: function () {
loadInstalls(selectedFolderId);