From dd062e127aef81e4d06c1568f6be18cc1167bb06 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 7 Jun 2017 15:51:30 +0200 Subject: [PATCH] Force LTR for code viewer in RTL languages --- wcfsetup/install/files/js/WCF.Message.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WCF.Message.js b/wcfsetup/install/files/js/WCF.Message.js index c61ec1c04f..4bd9a47143 100644 --- a/wcfsetup/install/files/js/WCF.Message.js +++ b/wcfsetup/install/files/js/WCF.Message.js @@ -64,7 +64,7 @@ WCF.Message.BBCode.CodeViewer = Class.extend({ }); if (this._dialog === null) { - this._dialog = $('
').hide().appendTo(document.body); + this._dialog = $('
').hide().appendTo(document.body); this._dialog.children('textarea').val($content); this._dialog.wcfDialog({ title: WCF.Language.get('wcf.message.bbcode.code.copy') @@ -76,6 +76,12 @@ WCF.Message.BBCode.CodeViewer = Class.extend({ } var textarea = this._dialog.children('textarea')[0]; + // force LTR for RTL languages + if (document.documentElement.dir === 'rtl') { + textarea.dir = 'ltr'; + textarea.style.setProperty('text-align', 'left', ''); + } + var selectAll = function () { textarea.selectionStart = 0; textarea.selectionEnd = textarea.value.length; -- 2.20.1