]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixes User Search by username.
authorraghunayyar <me@iraghu.com>
Wed, 12 Feb 2014 14:08:21 +0000 (19:38 +0530)
committerArthur Schiwon <blizzz@owncloud.com>
Mon, 2 Jun 2014 10:52:53 +0000 (12:52 +0200)
settings/js/users.js
settings/templates/users.php

index c1a52ef9bee3284998731ec619a93f93527f33c0..4609a56b494b0ad67339c216c9b558d20936f4cc 100644 (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();
                        }
                });
        });
index 89c83c3bd415ae8dd124a35d9975b337b1c7d7f0..ec9ca07416480f6625abb053f5e42740b2f4ec21 100644 (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));?>">