Revert "Revert Ember.run refactors"

This reverts commit fcb1ca52f96bdff1a49d558a4ffb18107d8334de.
This commit is contained in:
Robin Ward
2019-10-30 09:48:24 -04:00
parent 8e6ad99e92
commit 8d34f4bbd9
153 changed files with 493 additions and 319 deletions

View File

@ -1,3 +1,4 @@
import { schedule } from "@ember/runloop";
import Component from "@ember/component";
import WatchedWord from "admin/models/watched-word";
import {
@ -64,7 +65,7 @@ export default Component.extend({
message: I18n.t("admin.watched_words.form.success")
});
this.action(WatchedWord.create(result));
Ember.run.schedule("afterRender", () =>
schedule("afterRender", () =>
this.element.querySelector(".watched-word-input").focus()
);
})
@ -86,7 +87,7 @@ export default Component.extend({
@on("didInsertElement")
_init() {
Ember.run.schedule("afterRender", () => {
schedule("afterRender", () => {
$(this.element.querySelector(".watched-word-input")).keydown(e => {
if (e.keyCode === 13) {
this.send("submit");