Commit 37761d60 authored by ∞'s avatar 💻

Also use loader for modals

parent 6297d9c4
......@@ -24,19 +24,27 @@ export default class extends Controller {
'X-Modal': '1',
}
})
.then(res => res.text())
.then(res => {
var parser = new DOMParser()
var doc = parser.parseFromString(res, 'text/html')
var newbody = doc.getElementById('modal-body-ajax')
if (doc.querySelector('body.modal-fixed-footer')) {
this.modal.classList.add('modal-fixed-footer')
} else {
this.modal.classList.remove('modal-fixed-footer')
}
this.modal.innerHTML = newbody.innerHTML
this.initmodal()
.then(res => res.text())
.then(res => {
var parser = new DOMParser()
var doc = parser.parseFromString(res, 'text/html')
var newbody = doc.getElementById('modal-body-ajax')
if (doc.querySelector('body.modal-fixed-footer')) {
this.modal.classList.add('modal-fixed-footer')
} else {
this.modal.classList.remove('modal-fixed-footer')
}
this.modal.innerHTML = newbody.innerHTML
loader.hide()
this.initmodal()
}).catch(error => {
loader.hide()
M.toast({
html: error,
classes: 'orange darken-4',
displayLength: 15000,
})
})
}
childmodal() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment