documentation for all JS files
This commit is contained in:
@@ -1,4 +1,19 @@
|
||||
// Debounce function
|
||||
/**
|
||||
* @fileoverview Manages room search and filtering functionality.
|
||||
* This file handles:
|
||||
* - Room search input with debounced submission
|
||||
* - Clear filter functionality
|
||||
* - Form submission for room filtering
|
||||
*/
|
||||
|
||||
/**
|
||||
* Creates a debounced version of a function that delays its execution
|
||||
* until after a specified wait time has elapsed since the last time it was invoked.
|
||||
* @function
|
||||
* @param {Function} func - The function to debounce
|
||||
* @param {number} wait - The number of milliseconds to delay
|
||||
* @returns {Function} A debounced version of the provided function
|
||||
*/
|
||||
function debounce(func, wait) {
|
||||
let timeout;
|
||||
return function(...args) {
|
||||
@@ -7,6 +22,13 @@ function debounce(func, wait) {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes room search and filtering functionality when the DOM is loaded.
|
||||
* Sets up event listeners for:
|
||||
* - Search input with debounced form submission
|
||||
* - Clear filter button
|
||||
* @function
|
||||
*/
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const searchInput = document.getElementById('roomSearchInput');
|
||||
const form = document.getElementById('roomFilterForm');
|
||||
|
||||
Reference in New Issue
Block a user