From 2b771854790fa50ab871e3a62728a27b373a92ef Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 5 Sep 2016 12:19:15 +0200 Subject: [PATCH] Fixed code box viewer selection --- wcfsetup/install/files/js/WCF.Message.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WCF.Message.js b/wcfsetup/install/files/js/WCF.Message.js index dc489546a4..f4bfa110ab 100644 --- a/wcfsetup/install/files/js/WCF.Message.js +++ b/wcfsetup/install/files/js/WCF.Message.js @@ -75,7 +75,14 @@ WCF.Message.BBCode.CodeViewer = Class.extend({ this._dialog.wcfDialog('open'); } - this._dialog.children('textarea').select(); + var textarea = this._dialog.children('textarea')[0]; + var selectAll = function () { + textarea.selectionStart = 0; + textarea.selectionEnd = textarea.value.length; + }; + + textarea.addEventListener('mouseup', selectAll); + window.setTimeout(selectAll, 10); } }); -- 2.20.1