feat: groups price calculator admin crud, booking/offer flow and api
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { Controller } from '@hotwired/stimulus'
|
||||
import GLightbox from 'glightbox'
|
||||
|
||||
/* stimulusFetch: 'lazy' */
|
||||
export default class extends Controller {
|
||||
|
||||
static targets = ['item']
|
||||
|
||||
connect() {
|
||||
this.lightbox = GLightbox({
|
||||
elements: this.itemTargets.map((el) => ({
|
||||
href: el.dataset.galleryHref,
|
||||
type: 'image',
|
||||
alt: el.dataset.galleryAlt ?? '',
|
||||
})),
|
||||
})
|
||||
|
||||
this.itemTargets.forEach((el, index) => {
|
||||
el.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
this.lightbox.openAt(index)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
this.lightbox.destroy()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user