From c61fcf852d3d153b83d73304d49acce5696d36f6 Mon Sep 17 00:00:00 2001 From: Pablo Zmdl Date: Tue, 9 Dec 2025 12:26:26 +0100 Subject: [PATCH] Improve code to prevent sorting protected folders --- program/js/treelist.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/program/js/treelist.js b/program/js/treelist.js index cd76835bd..fc0c577e7 100644 --- a/program/js/treelist.js +++ b/program/js/treelist.js @@ -162,14 +162,14 @@ function rcube_treelist_widget(node, p) { e.stopPropagation(); return false; } + }) + .on('mousedown', 'li.mailbox.protected, li.mailbox.protected a', function (e) { // Prevent protected folders from being dragged/sorted. // We can't use the options of $.sortable() for that (then sub-folders of protected folders couldn't be // dragged, either), thus we implement it here. - if ($(e.target).parent().is('li.mailbox.protected')) { - e.preventDefault(); - e.stopPropagation(); - return false; - } + e.preventDefault(); + e.stopPropagation(); + return false; }); // activate search function