From 01f9657d6163a4faa3209045c3afa2c2f40cc5ae Mon Sep 17 00:00:00 2001 From: koirand Date: Fri, 17 Jan 2020 17:11:45 -1000 Subject: [PATCH] Fix bug that search icon image is not found. --- assets/js/search.js | 5 +++-- 1 file 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') }