mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 21:57:36 +08:00
DEV: add useBlockMode option for toolbar button text selection
Allows buttons to switch selection to block mode if needed.
This commit is contained in:
parent
c422520b4a
commit
6e3e0685fb
|
@ -601,7 +601,13 @@ export default Ember.Component.extend({
|
|||
this.set("value", `${pre}${hval}${example}${tail}${post}`);
|
||||
this._selectText(pre.length + hlen, example.length);
|
||||
} else if (opts && !opts.multiline) {
|
||||
const [hval, hlen] = getHead(head);
|
||||
let [hval, hlen] = getHead(head);
|
||||
|
||||
if (opts.useBlockMode && sel.value.split("\n").length > 1) {
|
||||
hval += "\n";
|
||||
hlen += 1;
|
||||
tail = `\n${tail}`;
|
||||
}
|
||||
|
||||
if (pre.slice(-hlen) === hval && post.slice(0, tail.length) === tail) {
|
||||
this.set(
|
||||
|
|
Loading…
Reference in New Issue
Block a user