summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-12 13:58:36 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-12 13:58:36 +0200
commit19e0ee821d5b2b6d3397a81411f4f3a4cbd2fa83 (patch)
tree952551d861bb8348d436367e8f048c5f85853cf5 /app/controllers
parent45bf65d04d046c0ea4a1150096b2a9b846d6c0b8 (diff)
Unify the four field-level pickers, fix search visibility
menu_items/parent_search/move_to_search/event_search each duplicated their own debounce-free AJAX call and result rendering. Replaced with one shared initSearchPicker, taking each picker's distinctive behavior (parent_search's live path preview, event_search's title hint) as a callback rather than a whole reimplementation. Adds a real debounce with an out-of-order-response guard -- none of the four had either before. admin_search (the Alt+F top-bar search) now shares the same function via its own url/isActive/header options, gaining the same guard and fixing an inconsistency of its own (it previously always slid its panel open, even on zero results). Each picker's results container gets its own id instead of sharing was ever supposed to be on screen at once, an assumption with no actual enforcement behind it. Styling moved from an id-pair (#menu_search_results, #search_results) to a shared .search_results class so a future picker never needs this file touched again. menu_search and the admin top-bar search now call Node.editor_search instead of the public, head-only Node.search -- both are admin-only, authenticated views, and had no reason to inherit the public search's "can't find a draft" limitation. The always-ignored :per_page => 1000 on the latter is gone too; Node.search's second argument was never read by the method at all. Also removed a stale #metadata a { text-transform: lowercase } rule, found while verifying the above -- written for the pre-subnav-removal expand-toggle, which no longer exists; it had been silently lowercasing nodes#edit's own, unrelated #metadata div (including move_to_search's results) by id coincidence ever since. #main_navigation and #overview_toggle intentionally left capitalized rather than special-cased -- both belong to the nav bar already slated to shrink to three icons, not worth polishing on the way out.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 435df57..3c45c49 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -31,7 +31,7 @@ class AdminController < ApplicationController
31 end 31 end
32 32
33 def search 33 def search
34 @results = Node.search params[:search_term], :per_page => 1000 34 @results = Node.editor_search(params[:search_term])
35 35
36 respond_to do |format| 36 respond_to do |format|
37 format.html do 37 format.html do
@@ -53,7 +53,7 @@ class AdminController < ApplicationController
53 if params[:search_term] == "Root" 53 if params[:search_term] == "Root"
54 @results = [Node.root] 54 @results = [Node.root]
55 else 55 else
56 @results = Node.search params[:search_term] 56 @results = Node.editor_search(params[:search_term])
57 end 57 end
58 58
59 respond_to do |format| 59 respond_to do |format|