From 04037ee7e143895795bb99b6b887e3ed18552bb1 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 4 Nov 2020 20:27:26 +0100 Subject: [PATCH] Incorrect handling of the default state of code blocks --- .../install/files/js/WoltLabSuite/Core/Ui/Redactor/Code.js | 4 ++-- .../install/files/ts/WoltLabSuite/Core/Ui/Redactor/Code.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Code.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Code.js index c486bafbdc..c18f8c7257 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Code.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Code.js @@ -170,12 +170,12 @@ define(["require", "exports", "tslib", "../../Core", "../../Dom/Util", "../../Ev onShow: () => { const pre = this._pre; const highlighter = document.getElementById(idHighlighter); - highlighter.value = pre.dataset.highlighter; + highlighter.value = pre.dataset.highlighter || ""; const line = ~~(pre.dataset.line || 1); const lineInput = document.getElementById(idLine); lineInput.value = line.toString(); const filename = document.getElementById(idFile); - filename.value = pre.dataset.file; + filename.value = pre.dataset.file || ""; }, title: Language.get("wcf.editor.code.edit"), }, diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Redactor/Code.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Redactor/Code.ts index 68c3e954ee..a2cb0fa107 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Redactor/Code.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Redactor/Code.ts @@ -218,14 +218,14 @@ class UiRedactorCode implements DialogCallbackObject { const pre = this._pre!; const highlighter = document.getElementById(idHighlighter) as HTMLSelectElement; - highlighter.value = pre.dataset.highlighter!; + highlighter.value = pre.dataset.highlighter || ""; const line = ~~(pre.dataset.line || 1); const lineInput = document.getElementById(idLine) as HTMLInputElement; lineInput.value = line.toString(); const filename = document.getElementById(idFile) as HTMLInputElement; - filename.value = pre.dataset.file!; + filename.value = pre.dataset.file || ""; }, title: Language.get("wcf.editor.code.edit"), -- 2.20.1