diff --git a/index.html b/index.html index a2630d4..1b69ad8 100644 --- a/index.html +++ b/index.html @@ -168,7 +168,7 @@

Exploring Islamic History

autocomplete="off" > / -
diff --git a/js/app.js b/js/app.js index 4a958d5..4510dc4 100644 --- a/js/app.js +++ b/js/app.js @@ -205,7 +205,7 @@ const Utils = { highlight(text, search) { if (!search) return text; - const regex = new RegExp(`(${this.escapeRegex(search)})`, 'gi'); + const regex = new RegExp('(' + this.escapeRegex(search) + ')', 'gi'); return text.replace(regex, '$1'); }, @@ -450,7 +450,7 @@ function renderCard(video, index = 0) {

No results found

Try different keywords or browse by category to find what you're looking for.

- @@ -1025,6 +1025,15 @@ function bindEvents() { // Grid click delegation if (DOM.grid) { DOM.grid.addEventListener('click', (e) => { + const clearBtn = e.target.closest('.clear-search-empty'); + if (clearBtn) { + if (DOM.search) { + DOM.search.value = ''; + DOM.search.dispatchEvent(new Event('input')); + } + return; + } + const wlBtn = e.target.closest('.watch-later-btn'); if (wlBtn) { e.stopPropagation();