REFACTOR: Use imports for Ember.run

This commit is contained in:
Robin Ward
2019-10-29 14:52:36 -04:00
parent c7475ee03b
commit 5ca60fcb6b
151 changed files with 485 additions and 270 deletions

View File

@ -1,3 +1,4 @@
import { schedule } from "@ember/runloop";
import Component from "@ember/component";
/**
A form to create an IP address that will be blocked or whitelisted.
@ -62,7 +63,7 @@ export default Component.extend({
.then(result => {
this.setProperties({ ip_address: "", formSubmitted: false });
this.action(ScreenedIpAddress.create(result.screened_ip_address));
Ember.run.schedule("afterRender", () =>
schedule("afterRender", () =>
this.element.querySelector(".ip-address-input").focus()
);
})
@ -84,7 +85,7 @@ export default Component.extend({
@on("didInsertElement")
_init() {
Ember.run.schedule("afterRender", () => {
schedule("afterRender", () => {
$(this.element.querySelector(".ip-address-input")).keydown(e => {
if (e.keyCode === 13) {
this.send("submit");