summaryrefslogtreecommitdiff
path: root/program/js/treelist.js
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-06-24 14:19:36 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-06-24 14:19:36 +0200
commitdfc9d7f20955c4d722b78f47a2a07d89592ed9a4 (patch)
treeabe2da623fae1a773759759e302959bcaec44b3f /program/js/treelist.js
parentbde467d8da9fd78b169d58ece3e87ea99c6d3e68 (diff)
Mute clicks on virtual treelist item links (they need tabindex=0 in order to be focusable by keyboard though)
Diffstat (limited to 'program/js/treelist.js')
-rw-r--r--program/js/treelist.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/program/js/treelist.js b/program/js/treelist.js
index 052d77bd5..8773cb884 100644
--- a/program/js/treelist.js
+++ b/program/js/treelist.js
@@ -116,6 +116,16 @@ function rcube_treelist_widget(node, p)
}
});
+ // mute clicks on virtual folder links (they need tabindex="0" in order to be selectable by keyboard)
+ container.on('mousedown', 'a', function(e) {
+ var link = $(e.target), node = indexbyid[dom2id(link.closest('li'))];
+ if (node && node.virtual && !link.attr('href')) {
+ e.preventDefault();
+ e.stopPropagation();
+ return false;
+ }
+ });
+
// activate search function
if (p.searchbox) {
searchfield = $(p.searchbox).on('keyup', function(e) {