From: Scimonster Date: Sat, 6 Dec 2014 16:46:49 +0000 (+0000) Subject: jquery.textSelection: Select sample text, if possible, when splitlines is true X-Git-Tag: 1.31.0-rc.0~13061 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=cc3c80bb7ef7f71851550e7053d3c21108b82435;p=lhc%2Fweb%2Fwiklou.git jquery.textSelection: Select sample text, if possible, when splitlines is true Bug: T72764 Change-Id: Ic39b56f78d8e0bfeaa5ad5ff3d0e9e6e6a0e56fc --- diff --git a/resources/src/jquery/jquery.textSelection.js b/resources/src/jquery/jquery.textSelection.js index 632769ba54..bd6518ddf1 100644 --- a/resources/src/jquery/jquery.textSelection.js +++ b/resources/src/jquery/jquery.textSelection.js @@ -243,7 +243,7 @@ selText = selText.replace( /\r?\n/g, '\r\n' ); post = post.replace( /\r?\n/g, '\r\n' ); } - if ( isSample && options.selectPeri && !options.splitlines ) { + if ( isSample && options.selectPeri && ( !options.splitlines || ( options.splitlines && selText.indexOf( '\n' ) === -1 ) ) ) { this.selectionStart = startPos + pre.length; this.selectionEnd = startPos + pre.length + selText.length; } else {