Skip to content

Commit

Permalink
feat: add the modal_toggle_selector parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed May 4, 2023
1 parent bb820d0 commit 5283b8c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assets/search/js/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default class Modal {
})

// open modal when clicking toggle button.
document.querySelectorAll('.search-modal-toggle').forEach((toggle) => {
document.querySelectorAll(params.modal_toggle_selector).forEach((toggle) => {
toggle.addEventListener('click', () => {
this.show()
})
Expand Down
1 change: 1 addition & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ path = "github.com/hugomods/icons/vendors/bootstrap"

[params.search]
modal_container = "body"
modal_toggle_selector = '.search-modal-toggle'
stall_threshold = 300
case_sensitive = false
min_match_char_length = 1
Expand Down
1 change: 1 addition & 0 deletions layouts/partials/search/functions/params.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{- $defaults := dict
"modal_container" "body"
"modal_toggle_selector" ".search-modal-toggle"
"stall_threshold" 300
"case_sensitive" false
"min_match_char_length" 1
Expand Down

0 comments on commit 5283b8c

Please sign in to comment.