diff options
author | koirand <koirand.jp@gmail.com> | 2020-01-18 06:11:45 +0300 |
---|---|---|
committer | koirand <koirand.jp@gmail.com> | 2020-01-18 06:11:45 +0300 |
commit | 01f9657d6163a4faa3209045c3afa2c2f40cc5ae (patch) | |
tree | dfbe6e36bf01ec843475b0c78c4ba796f0cf67ed /assets | |
parent | e69f90733e2dbc510a725759d7611a57acd75c05 (diff) |
Fix bug that search icon image is not found.
Diffstat (limited to 'assets')
-rw-r--r-- | assets/js/search.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/assets/js/search.js b/assets/js/search.js index 8a47ae4..1fe1bd0 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -112,11 +112,12 @@ const initUI = () => { const query = $(event.currentTarget).val() // Icon switching + const iconUrl = $('#searchBoxIcon').attr('src') if (query.length) { - $('#searchBoxIcon').attr('src', '../img/clear.png') + $('#searchBoxIcon').attr('src', iconUrl.replace('search.png', 'clear.png')) $('#searchBoxIcon').css('cursor', 'pointer') } else { - $('#searchBoxIcon').attr('src', '../img/search.png') + $('#searchBoxIcon').attr('src', iconUrl.replace('clear.png', 'search.png')) $('#searchBoxIcon').css('cursor', 'default') } |