From 18d7ca0820713c6db5bcfddeef6bd8f2ff34d65d Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Mon, 11 Oct 2021 18:28:41 +0200 Subject: [PATCH] feat: also use createRandomID helper in editor --- src/components/input/editor.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/input/editor.vue b/src/components/input/editor.vue index be2e9105e..d51ed19f4 100644 --- a/src/components/input/editor.vue +++ b/src/components/input/editor.vue @@ -53,6 +53,7 @@ import {createEasyMDEConfig} from './editorConfig' import AttachmentModel from '../../models/attachment' import AttachmentService from '../../services/attachment' import {findCheckboxesInText} from '../../helpers/checklistFromText' +import {createRandomID} from '@/helpers/randomId' export default { name: 'editor', @@ -122,6 +123,7 @@ export default { uploadImage: this.uploadEnabled, imageUploadFunction: this.uploadCallback, }), + checkboxId: createRandomID(), } }, watch: { @@ -208,7 +210,7 @@ export default { } checkboxNum++ - return `` + return `` }, link: (href, title, text) => { const isLocal = href.startsWith(`${location.protocol}//${location.hostname}`) @@ -260,7 +262,7 @@ export default { } } - const textCheckbox = document.getElementsByClassName(`text-checkbox-${this._uid}`) + const textCheckbox = document.getElementsByClassName(`text-checkbox-${this.checkboxId}`) if (textCheckbox) { for (const check of textCheckbox) { check.removeEventListener('change', this.handleCheckboxClick)