Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Mar 26, 2023
1 parent 06789f3 commit 9dea546
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/assets/js/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
(function () {
'use strict'

var searchInput = document.querySelector('#icons-body #search')
var query = new URLSearchParams(window.location.search).get('q')
var iconList = new List('icons-body', {
const searchInput = document.querySelector('#icons-body #search')
const query = new URLSearchParams(window.location.search).get('q')
const iconList = new List('icons-body', {
valueNames: [
'name', {
data: [
Expand All @@ -22,16 +22,16 @@
iconList.search(query)
}

iconList.on('searchComplete', function() {
var searchTerm = searchInput.value
var newUrl = new URL(location)
iconList.on('searchComplete', () => {
const searchTerm = searchInput.value
const newUrl = new URL(window.location)

if (searchTerm.length > 0) {
newUrl.searchParams.set('q', searchTerm)
} else {
newUrl.searchParams.delete('q')
}

history.replaceState(null, null, newUrl)
window.history.replaceState(null, null, newUrl)
})
})()

0 comments on commit 9dea546

Please sign in to comment.