From c17760b126d3a38f60d75147dc848f81258a96c2 Mon Sep 17 00:00:00 2001 From: Robert Niederreiter Date: Wed, 29 May 2024 19:59:56 +0200 Subject: [PATCH] Livesearch result renders to content, remove typeahead --- TODO.rst | 3 +- .../cone.example/src/cone/example/model.py | 3 +- js/src/livesearch.js | 96 +- src/cone/app/browser/ajax.py | 9 - src/cone/app/browser/layout.py | 6 - src/cone/app/browser/resources.py | 17 - src/cone/app/browser/search.py | 17 + src/cone/app/browser/static/cone/cone.app.js | 70 +- .../app/browser/static/cone/cone.app.min.js | 2 +- .../static/typeahead/typeahead.bundle.js | 2451 ----------------- .../browser/static/typeahead/typeahead.css | 189 -- 11 files changed, 121 insertions(+), 2742 deletions(-) create mode 100644 src/cone/app/browser/search.py delete mode 100644 src/cone/app/browser/static/typeahead/typeahead.bundle.js delete mode 100644 src/cone/app/browser/static/typeahead/typeahead.css diff --git a/TODO.rst b/TODO.rst index b3917a07..27002121 100644 --- a/TODO.rst +++ b/TODO.rst @@ -1,7 +1,8 @@ TODO ==== -- Live search. +- Main menu display children. +- Custom root node in example. - Referencebrowser widget. - Treibstoff styles. - Yafowil bootstrap 5 styles. diff --git a/examples/cone.example/src/cone/example/model.py b/examples/cone.example/src/cone/example/model.py index 34e6408e..6b8ec56d 100644 --- a/examples/cone.example/src/cone/example/model.py +++ b/examples/cone.example/src/cone/example/model.py @@ -232,6 +232,7 @@ def search(self, request, query): result.append({ 'value': md.title, 'target': make_url(request, node=child), - 'icon': md.icon + 'icon': md.icon, + 'description': md.description, }) return result diff --git a/js/src/livesearch.js b/js/src/livesearch.js index e9af2164..8ed226e1 100644 --- a/js/src/livesearch.js +++ b/js/src/livesearch.js @@ -17,10 +17,8 @@ export class LiveSearch { constructor(elem) { this.elem = elem; this.target = `${elem.data('search-target')}/livesearch`; - this.result = $('