mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2024-11-21 15:56:29 -05:00
Fix bug that search icon image is not found.
This commit is contained in:
parent
e69f90733e
commit
01f9657d61
1 changed files with 3 additions and 2 deletions
|
@ -112,11 +112,12 @@ const initUI = () => {
|
||||||
const query = $(event.currentTarget).val()
|
const query = $(event.currentTarget).val()
|
||||||
|
|
||||||
// Icon switching
|
// Icon switching
|
||||||
|
const iconUrl = $('#searchBoxIcon').attr('src')
|
||||||
if (query.length) {
|
if (query.length) {
|
||||||
$('#searchBoxIcon').attr('src', '../img/clear.png')
|
$('#searchBoxIcon').attr('src', iconUrl.replace('search.png', 'clear.png'))
|
||||||
$('#searchBoxIcon').css('cursor', 'pointer')
|
$('#searchBoxIcon').css('cursor', 'pointer')
|
||||||
} else {
|
} else {
|
||||||
$('#searchBoxIcon').attr('src', '../img/search.png')
|
$('#searchBoxIcon').attr('src', iconUrl.replace('clear.png', 'search.png'))
|
||||||
$('#searchBoxIcon').css('cursor', 'default')
|
$('#searchBoxIcon').css('cursor', 'default')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue