FIX: Inserting link wouldn't clear the text field sometimes

This commit is contained in:
Robin Ward 2015-11-27 13:31:52 -05:00
parent 540933dce3
commit 8c48c12498
2 changed files with 3 additions and 1 deletions

View file

@ -29,9 +29,11 @@ export default Ember.Component.extend({
if (key.keyCode === 27) {
this.send('cancel');
return false;
}
if (key.keyCode === 13) {
this.send('ok');
return false;
}
});
},

View file

@ -412,7 +412,7 @@ export default Ember.Component.extend({
const insert = `${sel.pre}${text}`;
this.set('value', `${insert}${sel.post}`);
this._selectText(insert.length, 0);
Ember.run.once("afterRender", () => { $("textarea.d-editor-input").focus(); } );
Ember.run.scheduleOnce("afterRender", () => this.$("textarea.d-editor-input").focus());
},
actions: {