mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-15 18:05:50 +01:00
dropdown menu filter method modified
intermediate match & case insensitive not using regexp
This commit is contained in:
@@ -49,10 +49,7 @@ $(function(){
|
||||
$('#filter-box').keyup(function(){
|
||||
var inputVal = $('#filter-box').val();
|
||||
$.each($('li.repo-link a'), function(index, elem) {
|
||||
console.log(inputVal);
|
||||
console.log(elem.text.trim());
|
||||
console.log(elem.text.trim().lastIndexOf(inputVal, 0));
|
||||
if (!inputVal || !elem.text.trim() || elem.text.trim().indexOf(inputVal) >= 0) {
|
||||
if ( !inputVal || !elem.text.trim() || elem.text.trim().toLowerCase().indexOf(inputVal.toLowerCase()) >= 0 ) {
|
||||
$(elem).parent().show();
|
||||
} else {
|
||||
$(elem).parent().hide();
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
$('#branch-control-input').keyup(function() {
|
||||
var inputVal = $('#branch-control-input').val();
|
||||
$.each($('#branch-control-input').parent().parent().find('a'), function(index, elem) {
|
||||
if (!inputVal || !elem.text.trim() || elem.text.trim().match(new RegExp(inputVal,'i'))) {
|
||||
if (!inputVal || !elem.text.trim() || elem.text.trim().toLowerCase().indexOf(inputVal.toLowerCase()) >= 0) {
|
||||
$(elem).parent().show();
|
||||
} else {
|
||||
$(elem).parent().hide();
|
||||
|
||||
@@ -32,7 +32,7 @@ $(function(){
|
||||
$('#@{filter}-input').keyup(function() {
|
||||
var inputVal = $('#@{filter}-input').val();
|
||||
$.each($('#@{filter}-input').parent().parent().find('a'), function(index, elem) {
|
||||
if (!inputVal || !elem.text.trim() || elem.text.trim().lastIndexOf(inputVal, 0) >= 0) {
|
||||
if ( !inputVal || !elem.text.trim() || elem.text.trim().toLowerCase().indexOf(inputVal.toLowerCase()) >=0 ) {
|
||||
$(elem).parent().show();
|
||||
} else {
|
||||
$(elem).parent().hide();
|
||||
|
||||
Reference in New Issue
Block a user