From bd7342314d1c51c2215691e580ea1abf2169410c Mon Sep 17 00:00:00 2001 From: curben <2809763-curben@users.noreply.gitlab.com> Date: Sun, 11 Aug 2019 00:09:23 +0930 Subject: [PATCH] refactor: use 'sites' search parameter https://stackoverflow.com/a/7305734 --- themes/typing/layout/_partial/header.ejs | 2 ++ themes/typing/source/js/typing.js | 20 +++----------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/themes/typing/layout/_partial/header.ejs b/themes/typing/layout/_partial/header.ejs index 62640c8..c15e1ce 100644 --- a/themes/typing/layout/_partial/header.ejs +++ b/themes/typing/layout/_partial/header.ejs @@ -8,6 +8,7 @@
+ @@ -31,6 +32,7 @@
+ diff --git a/themes/typing/source/js/typing.js b/themes/typing/source/js/typing.js index 3a097bd..ec4b15a 100644 --- a/themes/typing/source/js/typing.js +++ b/themes/typing/source/js/typing.js @@ -1,24 +1,10 @@ // Search button function -const searchClick = document.getElementById('searchClick') -searchClick.addEventListener('click', () => { - const searchTxt = document.getElementById('searchTxt') - const searchForm = document.getElementById('searchForm') - - searchTxt.value = searchTxt.value + ' site:curben.netlify.com' +document.getElementById('searchClick').addEventListener('click', () => { searchForm.submit() - - searchTxt.value = searchTxt.value.replace(' site:curben.netlify.com', '') }, false) -const searchClickMob = document.getElementById('searchClickMob') -searchClickMob.addEventListener('click', () => { - const searchTxt = document.getElementById('searchTxtMob') - const searchForm = document.getElementById('searchFormMob') - - searchTxt.value = searchTxt.value + ' site:curben.netlify.com' - searchForm.submit() - - searchTxt.value = searchTxt.value.replace(' site:curben.netlify.com', '') +document.getElementById('searchClickMob').addEventListener('click', () => { + searchFormMob.submit() }, false) /*