summaryrefslogtreecommitdiff
path: root/program/js/treelist.js
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-05-15 17:45:16 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-05-15 17:45:16 +0200
commit072f1aa97b0452f48c46e6a28ed8394d709c2faa (patch)
tree09a172e683da17f174f3a82970560ed0e564755a /program/js/treelist.js
parentb08986f37521cbb6224d225f102f76636f22f1d7 (diff)
Minor fixes for teelist searching
Diffstat (limited to 'program/js/treelist.js')
-rw-r--r--program/js/treelist.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/program/js/treelist.js b/program/js/treelist.js
index a99ee1e62..85d8aa928 100644
--- a/program/js/treelist.js
+++ b/program/js/treelist.js
@@ -282,12 +282,14 @@ function rcube_treelist_widget(node, p)
search_active = search_;
// add clone to current search results (top level)
- $('<li>')
- .attr('id', li.attr('id') + '--xsR')
- .attr('class', li.attr('class'))
- .addClass('searchresult__')
- .append(li.children().first().clone(true, true))
- .appendTo(container);
+ if (!li.is(':visible')) {
+ $('<li>')
+ .attr('id', li.attr('id') + '--xsR')
+ .attr('class', li.attr('class'))
+ .addClass('searchresult__')
+ .append(li.children().first().clone(true, true))
+ .appendTo(container);
+ }
}
}
// insert at top level
@@ -434,7 +436,7 @@ function rcube_treelist_widget(node, p)
var search_tree = function(items) {
$.each(items, function(i, node) {
var li, sli;
- if (!node.virtual && !node.deleted && String(node.text).toLowerCase().indexOf(q) >= 0) {
+ if (!node.virtual && !node.deleted && String(node.text).toLowerCase().indexOf(q) >= 0 && hits.indexOf(node.id) < 0) {
li = id2dom(node.id);
sli = $('<li>')
.attr('id', li.attr('id') + '--xsR')