From 87b5fa7e216442d278a0f9959f4a1c753606785b Mon Sep 17 00:00:00 2001 From: Brad Simpson Date: Tue, 26 Sep 2023 16:02:47 -0600 Subject: [PATCH 1/5] Add search field label element, remove drawer description to avoid duplication --- js/SEARCH_DEFAULTS.js | 1 - js/adapt-search.js | 3 +-- less/search.less | 5 +++++ templates/searchBox.hbs | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/js/SEARCH_DEFAULTS.js b/js/SEARCH_DEFAULTS.js index 1379211..91bc1e0 100644 --- a/js/SEARCH_DEFAULTS.js +++ b/js/SEARCH_DEFAULTS.js @@ -2,7 +2,6 @@ const SEARCH_DEFAULTS = { title: 'Search', - description: 'Type in search words', placeholder: '', noResultsMessage: 'Sorry, no results were found', awaitingResultsMessage: 'Formulating results...', diff --git a/js/adapt-search.js b/js/adapt-search.js index b830394..74182b5 100644 --- a/js/adapt-search.js +++ b/js/adapt-search.js @@ -67,10 +67,9 @@ class Search extends Backbone.Controller { addDrawerItem() { const searchConfig = Adapt.course.get('_search'); searchConfig.title = searchConfig.title || 'Search'; - searchConfig.description = searchConfig.description || 'Description'; const drawerObject = { title: searchConfig.title, - description: searchConfig.description, + description: '', className: 'is-search', drawerOrder: searchConfig._drawerOrder || 0 }; diff --git a/less/search.less b/less/search.less index db17358..1dd59d8 100755 --- a/less/search.less +++ b/less/search.less @@ -17,6 +17,11 @@ } } + &__textbox-label { + display: block; + margin-bottom: (@item-padding / 2); + } + &__items-container { border-top: 1px solid @drawer-item-hover; diff --git a/templates/searchBox.hbs b/templates/searchBox.hbs index c20bb65..c8e444d 100644 --- a/templates/searchBox.hbs +++ b/templates/searchBox.hbs @@ -1,3 +1,4 @@
- + +
From 411247496ca525c235c54a418dafd5feeac85404 Mon Sep 17 00:00:00 2001 From: Brad Simpson Date: Tue, 26 Sep 2023 16:12:03 -0600 Subject: [PATCH 2/5] Allow HTML tags in description --- templates/searchBox.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/searchBox.hbs b/templates/searchBox.hbs index c8e444d..567ae68 100644 --- a/templates/searchBox.hbs +++ b/templates/searchBox.hbs @@ -1,4 +1,4 @@
- +
From b8976f5e64980664c9209f646a651d528d8e8a6a Mon Sep 17 00:00:00 2001 From: Brad Simpson Date: Tue, 26 Sep 2023 16:27:36 -0600 Subject: [PATCH 3/5] Search label font styles --- less/search.less | 1 + 1 file changed, 1 insertion(+) diff --git a/less/search.less b/less/search.less index 1dd59d8..4b96c41 100755 --- a/less/search.less +++ b/less/search.less @@ -20,6 +20,7 @@ &__textbox-label { display: block; margin-bottom: (@item-padding / 2); + .drawer-item-body; } &__items-container { From 251f45c6578d8417e654cbe18f1b00206e3b20c5 Mon Sep 17 00:00:00 2001 From: Brad Simpson Date: Tue, 26 Sep 2023 16:28:08 -0600 Subject: [PATCH 4/5] Change search label to fallback to title if description is not set --- templates/searchBox.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/searchBox.hbs b/templates/searchBox.hbs index 567ae68..0e8eb5f 100644 --- a/templates/searchBox.hbs +++ b/templates/searchBox.hbs @@ -1,4 +1,4 @@
- +
From 1759f856eb2f46b07eb8ee4a50445cf8b17117a5 Mon Sep 17 00:00:00 2001 From: Brad Simpson Date: Tue, 26 Sep 2023 16:36:14 -0600 Subject: [PATCH 5/5] Remove description from template --- js/adapt-search.js | 1 - templates/searchSingleItem.hbs | 8 -------- 2 files changed, 9 deletions(-) diff --git a/js/adapt-search.js b/js/adapt-search.js index 74182b5..92a3ae3 100644 --- a/js/adapt-search.js +++ b/js/adapt-search.js @@ -69,7 +69,6 @@ class Search extends Backbone.Controller { searchConfig.title = searchConfig.title || 'Search'; const drawerObject = { title: searchConfig.title, - description: '', className: 'is-search', drawerOrder: searchConfig._drawerOrder || 0 }; diff --git a/templates/searchSingleItem.hbs b/templates/searchSingleItem.hbs index 52621d4..552d348 100644 --- a/templates/searchSingleItem.hbs +++ b/templates/searchSingleItem.hbs @@ -9,13 +9,5 @@ {{/if}} - {{#if description}} -
-
- {{{a11y_text description}}} -
-
- {{/if}} -