From 98984efd258137935aaccf792d5cb8dc273a0440 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Sat, 12 Aug 2023 14:16:29 -0400 Subject: [PATCH] =?UTF-8?q?refactor(search):=20=E2=99=BB=EF=B8=8F=20avoid?= =?UTF-8?q?=20unnessecary=20const=20declaration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/skins.citizen.search/typeaheadItem.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/resources/skins.citizen.search/typeaheadItem.js b/resources/skins.citizen.search/typeaheadItem.js index a93e727e..8ca50b34 100644 --- a/resources/skins.citizen.search/typeaheadItem.js +++ b/resources/skins.citizen.search/typeaheadItem.js @@ -51,8 +51,7 @@ function typeaheadItem() { item.classList.add( `citizen-typeahead__item-${data.size}` ); } if ( data.link ) { - const link = item.querySelector( '.citizen-typeahead__content' ); - link.setAttribute( 'href', data.link ); + item.querySelector( '.citizen-typeahead__content' ).setAttribute( 'href', data.link ); } if ( data.icon || data.thumbnail ) { const thumbnail = item.querySelector( '.citizen-typeahead__thumbnail' ); @@ -67,16 +66,13 @@ function typeaheadItem() { } } if ( data.title ) { - const title = item.querySelector( '.citizen-typeahead__title' ); - title.innerHTML = data.title; + item.querySelector( '.citizen-typeahead__title' ).innerHTML = data.title; } if ( data.label ) { - const label = item.querySelector( '.citizen-typeahead__label' ); - label.innerHTML = data.label; + item.querySelector( '.citizen-typeahead__label' ).innerHTML = data.label; } if ( data.desc ) { - const desc = item.querySelector( '.citizen-typeahead__description' ); - desc.innerHTML = data.desc; + item.querySelector( '.citizen-typeahead__description' ).innerHTML = data.desc; } } };