From f3e2812694423fe27905bec8feab406776a86be6 Mon Sep 17 00:00:00 2001 From: webmaster Date: Tue, 3 Nov 2026 14:37:05 +0000 Subject: [PATCH] fix(freelancer-directory): remove the Clear filter button; give the way back inside the empty state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Clear button, its .dir-clear-wrap container, the .dir-clear CSS and the JS that showed, hid and wired it are gone from the filter row. The search box keeps its native type=search clear. The empty state no longer names a missing control: it now reads "Nothing matches. Widen your search, or set the filters back to All." — with that phrase an inline text action (#dirEmptyReset) that does exactly what Clear did, so the one-click way back survives where a visitor needs it. --- odoo-community-developers/index.html | 58 ++++++++++++---------------- 1 file changed, 24 insertions(+), 34 deletions(-) diff --git a/odoo-community-developers/index.html b/odoo-community-developers/index.html index b8f2dcf..5c2eac1 100644 --- a/odoo-community-developers/index.html +++ b/odoo-community-developers/index.html @@ -201,8 +201,8 @@ min-width: 180px; } /* The dropdown boxes only — 30% narrower than the 180px default (0.7 x 180). - `> select` keeps the search box (its own 240px below) and the Clear wrapper - out of this rule, so only the four facets change width. */ .dir-filter:has(> select) { min-width: 126px; } @@ -240,23 +240,6 @@ background: var(--midnight); color: #fff; } - .dir-clear { - font-family: Inter, sans-serif; - font-size: 0.85rem; - cursor: pointer; - padding: 0.5rem 0.9rem; - border-radius: var(--radius); - border: 1px solid var(--line-brass); - background: transparent; - color: #fff; - } - .dir-clear:hover { - background: rgba(201, 162, 39, 0.14); - } - .dir-clear:focus-visible { - outline: 3px solid var(--brass-bright); - outline-offset: 2px; - } /* The standardised language multi-select: a closed checklist, scrollable so the form stays short. The level
-
- -
@@ -1022,7 +1018,7 @@
- +

You deal with the freelancer directly. The contract for the work is between you and them, and the terms, the price and the delivery are yours to agree. We are not a party to it — we publish the listings and nothing more; the conversation is between you and the freelancer.

@@ -2047,9 +2043,8 @@ function liveFilters(records) { var bar = document.getElementById("dirFilters"); var countries = countryNames(); - var clearWrap = bar.querySelector(".dir-clear-wrap"); Array.prototype.slice.call(bar.querySelectorAll(".dir-filter")).forEach(function (node) { - if (!node.classList.contains("dir-search") && !node.classList.contains("dir-clear-wrap")) { + if (!node.classList.contains("dir-search")) { bar.removeChild(node); } }); @@ -2111,8 +2106,7 @@ options.forEach(function (o) { sel.appendChild(new Option(o[1], o[0])); }); wrap.appendChild(lbl); wrap.appendChild(sel); - if (clearWrap) bar.insertBefore(wrap, clearWrap); - else bar.appendChild(wrap); + bar.appendChild(wrap); }); return active; } @@ -2149,9 +2143,9 @@ bar.addEventListener("input", function (event) { if (event.target && event.target.hasAttribute("data-search-box")) applyFilters(); }); - var clear = document.getElementById("dirClear"); - if (clear) { - clear.addEventListener("click", function () { + var emptyReset = document.getElementById("dirEmptyReset"); + if (emptyReset) { + emptyReset.addEventListener("click", function () { var box = bar.querySelector("[data-search-box]"); if (box) box.value = ""; Array.prototype.forEach.call(bar.querySelectorAll("select"), function (s) { s.value = ""; }); @@ -2166,7 +2160,6 @@ var grid = document.getElementById("dirGrid"); var count = document.getElementById("dirCount"); var empty = document.getElementById("dirEmpty"); - var clear = document.getElementById("dirClear"); if (!bar || !grid) return; var search = bar.querySelector("[data-search-box]"); @@ -2177,9 +2170,6 @@ bar.hidden = nothing; if (count) count.hidden = nothing; - if (clear) { - clear.hidden = nothing || (!query && !selects.some(function (s) { return s.value; })); - } var shown = 0; cards.forEach(function (card) {