Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorbodo <bodo@europa.frickelware.net>2016-05-28 14:10:13 +0300
committerbodo <bodo@europa.frickelware.net>2016-05-28 14:10:13 +0300
commit7dda6be38a318d2baf19c94c9c3380a0f0c9cd55 (patch)
treec60bf8e76fb317e6876a7e323101ef044e6b4653 /js
parentf72d2a80f719379fbe11c5a1f60fb25b4fa00326 (diff)
search function for users and groups
Diffstat (limited to 'js')
-rw-r--r--js/create_edit.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/js/create_edit.js b/js/create_edit.js
index 50674abd..970729b3 100644
--- a/js/create_edit.js
+++ b/js/create_edit.js
@@ -242,6 +242,36 @@ $(document).ready(function () {
}
});
+ $('.live-search-list-user li').each(function(){
+ $(this).attr('data-search-term', $(this).text().toLowerCase());
+ });
+
+ $('.live-search-box-user').on('keyup', function(){
+ var searchTerm = $(this).val().toLowerCase();
+ $('.live-search-list-user li').each(function(){
+ if ($(this).filter('[data-search-term *= ' + searchTerm + ']').length > 0 || searchTerm.length < 1) {
+ $(this).show();
+ } else {
+ $(this).hide();
+ }
+ });
+ });
+
+ $('.live-search-list-group li').each(function(){
+ $(this).attr('data-search-term', $(this).text().toLowerCase());
+ });
+
+ $('.live-search-box-group').on('keyup', function(){
+ var searchTerm = $(this).val().toLowerCase();
+ $('.live-search-list-group li').each(function(){
+ if ($(this).filter('[data-search-term *= ' + searchTerm + ']').length > 0 || searchTerm.length < 1) {
+ $(this).show();
+ } else {
+ $(this).hide();
+ }
+ });
+ });
+
var form = document.finish_poll;
var submit_finish_poll = document.getElementById('submit_finish_poll');
if (submit_finish_poll != null) {