Fixes User Search by username.

This commit is contained in:
raghunayyar 2014-02-12 19:38:21 +05:30 committed by Arthur Schiwon
parent c7af9cd6dd
commit 8e34316e04
2 changed files with 6 additions and 7 deletions

View file

@ -622,12 +622,12 @@ $(document).ready(function () {
});
// Implements User Search
$('#usersearchform input').keyup(function() {
var inputVal = $(this).val();
$('table tbody tr td.name').each(function() {
if ($('table tbody tr').text().search(new RegExp(inputVal, "i")) < 0) {
$('table tbody tr').fadeOut();
var inputVal = $(this).val(), regex = new RegExp(inputVal, "i");;
$('table tbody tr td.name').each(function (key,element) {
if (regex.test($(element).text())) {
$(element).parent().show();
} else {
$('table tbody tr').show();
$(element).parent().hide();
}
});
});

View file

@ -107,8 +107,7 @@ $_['subadmingroups'] = array_flip($items);
</div>
<?php endif; ?>
<form autocomplete="off" id="usersearchform">
<label><?php p($l->t( 'Search' )); ?></label>
<input type="text" class="input" />
<input type="text" class="input" placeholder="<?php p($l->t( 'Search by Username' )); ?>" />
</form>
</div>
<table class="hascontrols grid" data-groups="<?php p(json_encode($allGroups));?>">