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