1
0
Fork 0
mirror of https://github.com/eosswedenorg/apt synced 2026-06-16 04:34:56 +02:00

Adding assets/js/modules/alpine_collapse.js

This commit is contained in:
Henrik Hautakoski 2022-01-25 16:49:50 +01:00
parent 56c375f4d1
commit 648fa04d0a
No known key found for this signature in database
GPG key ID: 608414D93E862CCD
3 changed files with 21 additions and 1 deletions

View file

@ -3,6 +3,7 @@ import $ from 'jquery'
import AnchorJS from 'anchor-js'
import Alpine from 'alpinejs'
import alpine_search from './modules/alpine_search'
import alpine_collapse from './modules/alpine_collapse'
import ClipboardJS from 'clipboard'
import tippy from 'tippy.js'
@ -17,6 +18,7 @@ anchors.add();
// Alpine
// ------------------------------------------
Alpine.data('collapse', alpine_collapse)
Alpine.data('searchComponent', alpine_search)
Alpine.start()

View file

@ -0,0 +1,18 @@
// Alpine collapse component
export default () => ({
show: false,
trigger: {
['@click']() {
this.show = ! this.show;
},
['x-text']() {
return this.show ? 'Hide' : 'Show';
}
},
target: {
['x-show']() {
return this.show;
}
}
})

File diff suppressed because one or more lines are too long