From 24a11768f6c6ab329209670ba093bf01a10c3ca8 Mon Sep 17 00:00:00 2001 From: Matthieu Leproux Date: Wed, 13 Apr 2022 10:33:21 +0200 Subject: [PATCH] related to #1609 fixing highlight issues when dragging a node in the tree --- admin/themes/default/js/albums.js | 8 ++++++++ admin/themes/default/template/albums.tpl | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/admin/themes/default/js/albums.js b/admin/themes/default/js/albums.js index f83feb851..e1f41a163 100644 --- a/admin/themes/default/js/albums.js +++ b/admin/themes/default/js/albums.js @@ -206,6 +206,14 @@ $(document).ready(() => { $('.cat-move-order-popin input[name=id]').val(-1); }); + $('.tree').on('mousedown mouseup', function mouseState(e) { + if (e.type == "mousedown") { + $(".tree").addClass("dragging") + } else if (e.type == "mouseup") { + $(".dragging").removeClass("dragging") + } +}); + if (openCat != -1) { var node = $('.tree').tree('getNodeById', openCat); $('.tree').tree('openNode', node); diff --git a/admin/themes/default/template/albums.tpl b/admin/themes/default/template/albums.tpl index 9a7ab17fe..34161a598 100644 --- a/admin/themes/default/template/albums.tpl +++ b/admin/themes/default/template/albums.tpl @@ -522,4 +522,24 @@ input[name="position"] { color: #ffd7ad; background-color: #f98100; } + +.jqtree-moving .move-cat-container { + background-color: #ffd7ad; +} + +.jqtree-moving .move-cat-container .badge-container i, +.jqtree-moving .move-cat-container .node-icon{ + color: #ffd7ad; + background-color: #f98100; +} + +.dragging .move-cat-container { + pointer-events: none; +} + +.dragging .move-cat-container .move-cat-toogler, +.dragging .move-cat-container .move-cat-action-cont a, +.dragging .move-cat-container .move-cat-title-container{ + pointer-events: all; +} \ No newline at end of file