Browse Source

Search bar fixes for #1187 and #1205 (#1207)

Patrick G 2 years ago
parent
commit
64214a9426
1 changed files with 3 additions and 5 deletions
  1. 3 5
      public/js/index.js

+ 3 - 5
public/js/index.js

@@ -1523,11 +1523,9 @@ $(function () {
1523 1523
 
1524 1524
     $("#search_repo").on('change paste keyup',function(){
1525 1525
         var value = $(this).val();
1526
-        if(!value){
1527
-            $('.list-search-style').html('');
1528
-        } else{
1529
-            $('.list-search-style').html('.search-list li:not([data-title*="' + value + '"]) {display: none;}');
1530
-        }
1526
+        $.map($('.search-list li'), function(i) {
1527
+            $(i).css("display", (value.trim().length == 0 || $(i).attr("data-title").trim().toLowerCase().indexOf(value.trim().toLowerCase()) > -1) ? "" : "none");
1528
+        });
1531 1529
     });
1532 1530
 
1533 1531
     // Parse SSH Key