Remove more jQuery
This commit is contained in:
parent
cb8d022be7
commit
6d8f2fa790
|
@ -1,6 +1,5 @@
|
|||
/* eslint-disable no-new */
|
||||
|
||||
import $ from 'jquery'
|
||||
import Isotope from 'isotope-layout/dist/isotope.pkgd.js'
|
||||
import onmount from 'onmount'
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import onmount from 'onmount'
|
||||
import wrapify from '../wrapify'
|
||||
import ready from 'dom101/ready'
|
||||
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
import $ from 'jquery'
|
||||
import onmount from 'onmount'
|
||||
import * as Search from '../helpers/search'
|
||||
import qs from '../helpers/qs'
|
||||
import on from 'dom101/on'
|
||||
|
||||
onmount('[data-js-search-input]', function () {
|
||||
const $this = $(this)
|
||||
|
||||
$this.on('input', () => {
|
||||
const val = $this.val()
|
||||
on(this, 'input', () => {
|
||||
const val = this.value
|
||||
|
||||
if (val === '') {
|
||||
Search.showAll()
|
||||
|
@ -18,7 +16,7 @@ onmount('[data-js-search-input]', function () {
|
|||
|
||||
const query = (qs(window.location.search) || {}).q
|
||||
if (query && query.length) {
|
||||
$this.val(query)
|
||||
Search.show(query)
|
||||
this.value = query
|
||||
setTimeout(() => { Search.show(query) })
|
||||
}
|
||||
})
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
import $ from 'jquery'
|
||||
import onmount from 'onmount'
|
||||
import permutate from '../helpers/permutate'
|
||||
|
||||
|
@ -8,9 +6,8 @@ import permutate from '../helpers/permutate'
|
|||
*/
|
||||
|
||||
onmount('[data-js-searchable-item]', function () {
|
||||
const $this = $(this)
|
||||
const data = $this.data('js-searchable-item')
|
||||
const data = JSON.parse(this.getAttribute('data-js-searchable-item') || '{}')
|
||||
const words = permutate(data)
|
||||
|
||||
$this.attr('data-search-index', words.join(' '))
|
||||
this.setAttribute('data-search-index', words.join(' '))
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue