From e9ceead91b3d02442d2782bbcff1bcc954e5f20b Mon Sep 17 00:00:00 2001 From: "Satur@it-depot.ru" Date: Thu, 6 Mar 2025 14:03:49 +0300 Subject: [PATCH] dark fix 2 --- templates/index.html | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/templates/index.html b/templates/index.html index c82a283..4c809e0 100644 --- a/templates/index.html +++ b/templates/index.html @@ -83,6 +83,15 @@ transform: translateY(-50%); margin-left: 0; } + /* Стили для выбранного узла в jstree в темной теме */ + .jstree-default-dark .jstree-clicked { + background: #005580 !important; + color: #e0e0e0 !important; + } + .jstree-default-dark .jstree-hovered { + background: #003d66 !important; + color: #e0e0e0 !important; + } #search-container { position: absolute; top: 10px; @@ -112,10 +121,16 @@ display: table-cell; padding: 5px; text-align: center; - font-weight: bold; + font-weight: bold; + } + .header > div:hover { + background: #e0e0e0; + color: #000; /* Тёмный текст на светлом фоне в светлой теме */ + } + .header.dark-theme > div:hover { + background: #444; + color: #e0e0e0; /* Светлый текст на тёмном фоне в темной теме */ } - .header > div:hover { background: #e0e0e0; } - .header > div.dark-theme:hover { background: #444; } .sort-arrow { font-size: 12px; margin-left: 5px; } .protocol-icon { margin-right: 5px; @@ -388,6 +403,8 @@ // Применяем темную тему к уже загруженным элементам таблицы document.querySelectorAll('.install-item').forEach(item => item.classList.add('dark-theme')); document.querySelector('.header').classList.add('dark-theme'); + // Добавляем класс для темной темы в jstree + $('#folder-tree').addClass('jstree-default-dark'); } }); @@ -402,6 +419,7 @@ const themeToggle = document.querySelector('.theme-toggle'); const header = document.querySelector('.header'); const installItems = document.querySelectorAll('.install-item'); + const folderTree = $('#folder-tree'); if (body.classList.contains('dark-theme')) { body.classList.remove('dark-theme'); @@ -414,6 +432,7 @@ themeToggle.classList.remove('dark-theme'); header.classList.remove('dark-theme'); installItems.forEach(item => item.classList.remove('dark-theme')); + folderTree.removeClass('jstree-default-dark'); themeToggle.textContent = 'Темная тема'; localStorage.setItem('theme', 'light'); } else { @@ -427,6 +446,7 @@ themeToggle.classList.add('dark-theme'); header.classList.add('dark-theme'); installItems.forEach(item => item.classList.add('dark-theme')); + folderTree.addClass('jstree-default-dark'); themeToggle.textContent = 'Светлая тема'; localStorage.setItem('theme', 'dark'); } @@ -437,7 +457,7 @@ loadFolders(); loadInstalls(null); - // Инициализация дерева папок + // Инициализация дерева папок с настройками для темной темы $('#folder-tree').jstree({ 'core': { 'data': function (node, cb) { @@ -470,7 +490,10 @@ console.error("Error loading folders:", textStatus, error); }); }, - 'check_callback': true + 'check_callback': true, + 'themes': { + 'variant': 'default-dark' // Устанавливаем темную тему по умолчанию для jstree + } }, 'plugins': ['dnd', 'html_data'], 'dnd': {