From 895f7a42b8716f4f91d9fe7a4e34f0b8a90d399c Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 29 Jan 2015 22:05:30 +0100 Subject: [PATCH] Enable search filter in the admin area --- public/js/vroom.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/public/js/vroom.js b/public/js/vroom.js index cc742c5..c0985a7 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -420,7 +420,7 @@ function initAdmin(){ }); } - + // Request the list of existing rooms to the server function getRooms(){ $.ajax({ data: { @@ -516,6 +516,16 @@ function initAdmin(){ } }); }); + + // Update room list when searching + $('#searchRoom').on('input', function(){ + var lastInput = +new Date; + setTimeout(function(){ + if (lastInput + 500 < +new Date){ + updateRoomList($('#searchRoom').val(), 0, matches); + } + }, 600); + }); } // This is the main function called when you join a room