mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user