FIX: Autocomplete wasn't properly updating `d-editor`
This commit is contained in:
parent
8349669f8e
commit
08e43588f6
|
@ -301,6 +301,9 @@ export default Ember.Component.extend({
|
||||||
$editorInput.autocomplete({
|
$editorInput.autocomplete({
|
||||||
template: template,
|
template: template,
|
||||||
key: ":",
|
key: ":",
|
||||||
|
afterComplete(text) {
|
||||||
|
self.set('value', text);
|
||||||
|
},
|
||||||
|
|
||||||
transformComplete(v) {
|
transformComplete(v) {
|
||||||
if (v.code) {
|
if (v.code) {
|
||||||
|
|
|
@ -146,6 +146,10 @@ export default function(options) {
|
||||||
text = text.substring(0, completeStart) + (options.key || "") + term + ' ' + text.substring(completeEnd + 1, text.length);
|
text = text.substring(0, completeStart) + (options.key || "") + term + ' ' + text.substring(completeEnd + 1, text.length);
|
||||||
me.val(text);
|
me.val(text);
|
||||||
Discourse.Utilities.setCaretPosition(me[0], completeStart + 1 + term.length);
|
Discourse.Utilities.setCaretPosition(me[0], completeStart + 1 + term.length);
|
||||||
|
|
||||||
|
if (options && options.afterComplete) {
|
||||||
|
options.afterComplete(text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,3 +27,5 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{plugin-outlet "discovery-below"}}
|
||||||
|
|
Loading…
Reference in New Issue