From d5fd1d465cfb6c2281fcb9c23d9d6c5d9b0a8eb9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 17 Mar 2021 15:58:36 +0100 Subject: [PATCH] Use WoltLabSource.isActive() to check whether the source view is enabled Apparently the previous version, checking the height of the textarea, is broken in the Kiwi Browser for Android even though it pretends to be a standard Chrome 88 without indicating anywhere within the User-Agent that it is not. Luckily the fix is easy enough and technically the more correct solution even for non-broken browsers. I verified the correct functionality using Kiwi on Android and Firefox on Linux. --- .../files/js/3rdParty/redactor2/plugins/WoltLabSource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabSource.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabSource.js index 9b07098964..eb52b63a2b 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabSource.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabSource.js @@ -109,7 +109,7 @@ $.Redactor.prototype.WoltLabSource = function() { }).bind(this); WCF.System.Event.addListener('com.woltlab.wcf.redactor2', 'validate_' + id, (function (data) { - if (textarea.clientHeight) { + if (this.WoltLabSource.isActive()) { data.api.throwError(this.$element[0], WCF.Language.get('wcf.editor.source.error.active')); data.valid = false; } -- 2.20.1