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