Revert "Revert Ember.run refactors"

This reverts commit fcb1ca52f9.
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,5 @@
import { next } from "@ember/runloop";
import { schedule } from "@ember/runloop";
import { on } from "ember-addons/ember-computed-decorators";
export default Ember.Mixin.create({
@@ -92,8 +94,8 @@ export default Ember.Mixin.create({
focusFilterOrHeader() {
const context = this;
// next so we are sure it finised expand/collapse
Ember.run.next(() => {
Ember.run.schedule("afterRender", () => {
next(() => {
schedule("afterRender", () => {
if (
!context.$filterInput() ||
!context.$filterInput().is(":visible") ||
@@ -129,9 +131,9 @@ export default Ember.Mixin.create({
this.focusFilterOrHeader();
this.autoHighlight();
Ember.run.next(() => {
next(() => {
this._boundaryActionHandler("onExpand", this);
Ember.run.schedule("afterRender", () => {
schedule("afterRender", () => {
if (!this.isDestroying && !this.isDestroyed) {
this._adjustPosition();
}
@@ -144,9 +146,9 @@ export default Ember.Mixin.create({
this.set("isExpanded", false);
Ember.run.next(() => {
next(() => {
this._boundaryActionHandler("onCollapse", this);
Ember.run.schedule("afterRender", () => {
schedule("afterRender", () => {
if (!this.isDestroying && !this.isDestroyed) {
this._removeFixedPosition();
}

View File

@@ -1,3 +1,5 @@
import { throttle } from "@ember/runloop";
import { schedule } from "@ember/runloop";
import { on } from "ember-addons/ember-computed-decorators";
const { bind } = Ember.run;
@@ -138,7 +140,7 @@ export default Ember.Mixin.create({
this.set("renderedFilterOnce", true);
}
Ember.run.schedule("afterRender", () => {
schedule("afterRender", () => {
this.$filterInput()
.focus()
.val(this.$filterInput().val() + String.fromCharCode(keyCode));
@@ -267,7 +269,7 @@ export default Ember.Mixin.create({
const direction = keyCode === 38 ? -1 : 1;
Ember.run.throttle(this, this._moveHighlight, direction, $rows, 32);
throttle(this, this._moveHighlight, direction, $rows, 32);
},
didPressBackspaceFromFilter(event) {
@@ -428,7 +430,7 @@ export default Ember.Mixin.create({
},
_highlightRow($row) {
Ember.run.schedule("afterRender", () => {
schedule("afterRender", () => {
$row.trigger("mouseover").focus();
this.focus();
});