Revert "Revert "DEV: Wrap Ember.run.debounce. (#11352)"" (#11509)

* Revert "Revert "DEV: Wrap `Ember.run.debounce`. (#11352)" (#11465)"

This reverts commit aa0d4ea764959bd7ec5127f78dbec68de4dc8337.

* Correctly debounce onScroll function
This commit is contained in:
Roman Rizzi
2020-12-18 10:18:52 -03:00
committed by GitHub
parent f296ca4b4a
commit 142e0ae062
51 changed files with 526 additions and 358 deletions

View File

@ -3,20 +3,24 @@ import I18n from "I18n";
import { INPUT_DELAY } from "discourse-common/config/environment";
import Permalink from "admin/models/permalink";
import bootbox from "bootbox";
import discourseDebounce from "discourse/lib/debounce";
import discourseDebounce from "discourse-common/lib/debounce";
import { observes } from "discourse-common/utils/decorators";
export default Controller.extend({
loading: false,
filter: null,
@observes("filter")
show: discourseDebounce(function () {
_debouncedShow() {
Permalink.findAll(this.filter).then((result) => {
this.set("model", result);
this.set("loading", false);
});
}, INPUT_DELAY),
},
@observes("filter")
show() {
discourseDebounce(this, this._debouncedShow, INPUT_DELAY);
},
actions: {
recordAdded(arg) {