From: Alexander Ebert Date: Mon, 5 Sep 2016 10:19:15 +0000 (+0200) Subject: Fixed code box viewer selection X-Git-Tag: 3.0.0_Beta_1~304 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2b771854790fa50ab871e3a62728a27b373a92ef;p=GitHub%2FWoltLab%2FWCF.git Fixed code box viewer selection --- 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); } });