Make sure the editor does not break if the text has checkboxes
This commit is contained in:
parent
0b620a07ef
commit
188d54ebe6
1 changed files with 26 additions and 20 deletions
|
@ -345,7 +345,9 @@ export default {
|
|||
// not already made available.
|
||||
// Some docs at https://stackoverflow.com/q/62865160/10924593
|
||||
this.$nextTick(() => {
|
||||
document.getElementsByClassName('attachment-image').forEach(img => {
|
||||
const attachmentImage = document.getElementsByClassName('attachment-image')
|
||||
if(attachmentImage) {
|
||||
attachmentImage.forEach(img => {
|
||||
// The url is something like /tasks/<id>/attachments/<id>
|
||||
const parts = img.dataset.src.substr(window.API_URL.length + 1).split('/')
|
||||
const taskId = parseInt(parts[1])
|
||||
|
@ -361,11 +363,15 @@ export default {
|
|||
img.src = url
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
document.getElementsByClassName(`text-checkbox-${this._uid}`).forEach(check => {
|
||||
const textCheckbox = document.getElementsByClassName(`text-checkbox-${this._uid}`)
|
||||
if(textCheckbox) {
|
||||
textCheckbox.forEach(check => {
|
||||
check.removeEventListener('change', this.handleCheckboxClick)
|
||||
check.addEventListener('change', this.handleCheckboxClick)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCheckboxClick(e) {
|
||||
|
|
Loading…
Reference in a new issue