mysterious-toddler-20573
04/17/2021, 8:06 PMgorgeous-ghost-95789
04/17/2021, 8:07 PMmysterious-toddler-20573
04/17/2021, 8:07 PMon click from #themeToggler
toggle @href between "/static/css/0x-light.css" and "/static/css/0x-dark.css"
set cookie "theme" to @href expiring 1 year from now
endmysterious-toddler-20573
04/17/2021, 8:07 PMmysterious-toddler-20573
04/17/2021, 8:07 PMmillions-diamond-89785
04/17/2021, 9:46 PMsparse-musician-64201
04/18/2021, 3:58 PMblue-television-69795
04/18/2021, 5:58 PMhtmx.ajax() doesn't have a timeout feature.
following is my use case :
- call htmx.ajax('/verify-address'), with a timeout 10s
- when it hits the timeout, then it wil call htmx.ajax('/verify-address-timeout')
as a workaround, I use window.setTimeout(), but the problem is I don't have any idea on how to cancel/reject the previous request
const formData = htmx.values(formEl);
let verifySuccess = false;
htmx.ajax('GET', `/ajax/postiecustom/verify-address?${CommonHelper.objectToQueryString(formData)}`, '#modals-container')
.then(() => {
console.log('validation is shown!');
verifySuccess = true;
});
// if verify is not success after timeout (6s)
// then reject the previous request
// then request modal timeout
window.setTimeout(() => {
if (!verifySuccess) {
// TODO - have to find a way to cancel the previous modalContent
htmx.ajax('GET', '/ajax/postiecustom/verify-address-timeout', '#modals-container')
.then(() => {
console.log('validation timeout is shown!');
});
}
}, 6000);blue-television-69795
04/18/2021, 6:04 PMhtmx.ajax() has timeout params in the future,
htmx.ajax('GET', '/first-request', '#selector', { timeout: 6000 })
.then(() => {
console.log('validation is shown!');
})
.catch(() => {
htmx.ajax('GET', '/timeout-request', '#selector')
.then(() => {
console.log('validation timeout is shown!');
});
});plain-kangaroo-26043
04/18/2021, 8:00 PMsalmon-xylophone-28580
04/18/2021, 8:21 PMplain-kangaroo-26043
04/18/2021, 8:55 PMplain-kangaroo-26043
04/18/2021, 8:55 PMplain-kangaroo-26043
04/18/2021, 8:57 PMmysterious-toddler-20573
04/18/2021, 9:54 PMmysterious-toddler-20573
04/18/2021, 9:54 PMplain-kangaroo-26043
04/19/2021, 6:56 AMplain-kangaroo-26043
04/19/2021, 6:57 AMplain-kangaroo-26043
04/19/2021, 7:00 AMplain-kangaroo-26043
04/19/2021, 7:00 AMplain-kangaroo-26043
04/19/2021, 7:01 AMmysterious-toddler-20573
04/19/2021, 1:08 PMmysterious-toddler-20573
04/19/2021, 1:17 PMechoing-dress-67727
04/19/2021, 3:33 PMhx-swap="innerHTML show:top" and hx-swap="innerHTML scroll:top" but those don't seem to scroll to the top of the page. Instead they scroll to show the top of the element and scroll the element overflow to the top, respectively. I want something that will scroll the viewport all the way to the topmysterious-toddler-20573
04/19/2021, 3:51 PMmysterious-toddler-20573
04/19/2021, 3:51 PMmysterious-toddler-20573
04/19/2021, 3:53 PMmysterious-toddler-20573
04/19/2021, 3:53 PMscroll:windowTop and scroll:windowBottomechoing-dress-67727
04/19/2021, 4:01 PMblue-television-69795
04/19/2021, 4:13 PM