mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 06:56:01 +08:00
Clicking on popup menu options should refocus on selected text.
This commit is contained in:
parent
5d9e6d2395
commit
95a58b80d7
|
@ -388,6 +388,9 @@ export default Ember.Component.extend({
|
|||
left = replyWidth - popupWidth - 40;
|
||||
}
|
||||
|
||||
const selected = toolbarEvent.selected;
|
||||
toolbarEvent.selectText(selected.start, selected.end - selected.start);
|
||||
|
||||
this.sendAction('showOptions', toolbarEvent,
|
||||
{ position: "absolute", left, top });
|
||||
},
|
||||
|
|
|
@ -507,6 +507,7 @@ export default Ember.Component.extend({
|
|||
const selected = this._getSelected(button.trimLeading);
|
||||
const toolbarEvent = {
|
||||
selected,
|
||||
selectText: (from, length) => this._selectText(from, length),
|
||||
applySurround: (head, tail, exampleKey) => this._applySurround(selected, head, tail, exampleKey),
|
||||
applyList: (head, exampleKey) => this._applyList(selected, head, exampleKey),
|
||||
addText: text => this._addText(selected, text),
|
||||
|
|
Loading…
Reference in New Issue
Block a user