From 97f51a73d4a2e7fb42ccf1107abf07e985cfa13a Mon Sep 17 00:00:00 2001 From: erdgeist Date: Tue, 30 Jun 2026 03:36:51 +0200 Subject: Improve admin search overlay layout and behaviour - Widen overlay (300px -> min(520px, 90vw)), centre instead of hardcoded left:400px, so it scales from mobile to desktop - Split title and unique_name into separate JSON fields and DOM elements; two-line result layout (bold title, small grey monospace path) instead of "Title (path)" wrapping awkwardly - Add small margin between title and path line - Fix event handler stacking: keyup/escape/outside-click handlers were being rebound on every display_toggle call. Moved all bindings to initialize(), display_toggle() now only shows/hides - Switch search input from keyup to input event, catching paste and cut via mouse which keyup misses - Add Escape key and outside-click to dismiss the overlay - Stop clearing search box and results on close; reopening now preserves prior search, matching standard search UI behaviour - Link search results to node_path instead of edit_node_path, since opening edit auto-locks the node - Add "press Enter to see all results" hint in dropdown - Disable browser autocomplete on search input --- app/controllers/admin_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers') diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 1a94a77..d671384 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -40,7 +40,7 @@ class AdminController < ApplicationController format.js do render( :json => @results.map do |node| if node - {:id => node.id, :title => " #{node.title} (#{node.unique_name})", :edit_path => edit_node_path(node)} + { :id => node.id, :title => node.title, :unique_name => node.unique_name, :node_path => node_path(node) } end end ) -- cgit v1.3