mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
chore: move time picker to separate component
This commit is contained in:
@ -1,3 +1,9 @@
|
||||
// To use this, do the following:
|
||||
// 1. Include petite-vue
|
||||
// 2. Define variables timeSelection, fromDate, toDate in an inline script below previous
|
||||
// 3. Include this script file below previous
|
||||
// 4. Include time-picker.tpl.html template partial in body
|
||||
|
||||
PetiteVue.createApp({
|
||||
$delimiters: ['${', '}'],
|
||||
state: {
|
||||
@ -7,7 +13,7 @@ PetiteVue.createApp({
|
||||
toDate: toDate,
|
||||
timeSelection: timeSelection,
|
||||
onDateUpdated() {
|
||||
formTimePicker.submit()
|
||||
document.getElementById('time-picker-form').submit()
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('click', (e) => {
|
||||
@ -21,4 +27,4 @@ PetiteVue.createApp({
|
||||
this.timeSelection = refEl ? refEl.innerText : 'Unknown'
|
||||
}
|
||||
}
|
||||
}).mount('#summary-page')
|
||||
}).mount('#time-picker-container')
|
Reference in New Issue
Block a user