summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-05 21:49:21 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-05 21:49:21 +0200
commit1fa2f3821497d5529a6753cee84cf5ca679e8bcc (patch)
tree7c6e98cfc9fc0b452e055c6201fb8aefa3c71965 /app/views
parent9c630d186003a47563be2e3547485060dac7dd98 (diff)
Fix admin search results colliding with other search widgets
layouts/admin.html.erb's top-bar search results div shared id "search_results" with nodes#new/nodes#edit's parent-search widget - since the layout renders on every admin page, whichever widget's JS ran last silently won the shared ID, putting top-bar results into the parent-search box on affected pages. Renamed to "menu_search_results" and updated admin_search.js to match. Also modernizes admin_search.js's event bindings from keyup/keydown/ keypress/paste/cut + .attr("value") to input + .val() throughout (menu_items, parent_search, move_to_search) - the multi-event binding was working around old IE compatibility that .val() + "input" already handles correctly. parent_search's result rendering now matches menu_search's convention (real <p>/<a> markup with a .result_path span) instead of a bare <a> in a throwaway wrapper div, so the same CSS rule now correctly applies to both. menu_search's JSON response gains node_path per result, matching what admin_search's own results already provide - not yet consumed by parent_search/move_to_search, which still render click-to-select links rather than navigable ones (correct for their purpose - selecting a value, not leaving the page). Known remaining gap, not fixed here: menu_items, parent_search, and move_to_search still all target the literal id "search_results" between themselves. No live collision today since none of the three currently share a page, but it's the same fragility as the bug above - tracked alongside the existing menu_items/parent_search/move_to_search consolidation backlog item rather than treated as resolved.
Diffstat (limited to 'app/views')
-rw-r--r--app/views/layouts/admin.html.erb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb
index 4536693..a7ce68a 100644
--- a/app/views/layouts/admin.html.erb
+++ b/app/views/layouts/admin.html.erb
@@ -49,7 +49,7 @@
49 <span>Search: </span><%= text_field_tag :search_term, nil, autocomplete: "off" %> 49 <span>Search: </span><%= text_field_tag :search_term, nil, autocomplete: "off" %>
50 <% end %> 50 <% end %>
51 </div> 51 </div>
52 <div id="search_results" style="display: none"> 52 <div id="menu_search_results" style="display: none">
53 53
54 </div> 54 </div>
55 </div> 55 </div>