Skip to content

Commit

Permalink
fix: make sure hiding search icon before showing spinner icon (#215)
Browse files Browse the repository at this point in the history
style: change spinner icon size to 1.35em
  • Loading branch information
razonyang committed Feb 20, 2024
1 parent a33e085 commit 7fe1301
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions assets/search/js/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ export default class Form {
})
})

this.spinner.show()
engine.init().then(() => {
this.input.removeAttribute('disabled')
}).catch((err) => {
Expand Down
5 changes: 4 additions & 1 deletion assets/search/js/spinner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export default class Spinner {

show() {
this.getSearchIcon().classList.add('disabled')
this.getElement().classList.remove('disabled')
// delay for making sure the search icon was hidden.
setTimeout(() => {
this.getElement().classList.remove('disabled')
}, 1)
}
}
2 changes: 1 addition & 1 deletion layouts/partials/search/assets/js-resource.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"history" (partial "icons/icon" (dict "vendor" "bootstrap" "name" "clock" "size" "2em"))
"meta" (partial "icons/icon" (dict "vendor" "bootstrap" "name" "info-circle" "size" "2em"))
"search" (partial "icons/icon" (dict "vendor" "bootstrap" "name" "search" "size" "1.25em"))
"spinner" (partial "icons/icon" (dict "vendor" "bootstrap" "name" "arrow-clockwise" "size" "1.25em"))
"spinner" (partial "icons/icon" (dict "vendor" "bootstrap" "name" "arrow-clockwise" "size" "1.35em"))
"lang" (partial "icons/icon" (dict "vendor" "bootstrap" "name" "translate" "size" "1em"))
"sort" (partial "icons/icon" (dict "vendor" "bootstrap" "name" "sort-down" "size" "1em"))
"expand" (partial "icons/icon" (dict "vendor" "bootstrap" "name" "chevron-expand" "size" "1em"))
Expand Down

0 comments on commit 7fe1301

Please sign in to comment.