mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 13:07:19 +08:00
* Revert "Revert "DEV: Wrap `Ember.run.debounce`. (#11352)" (#11465)" This reverts commit aa0d4ea764959bd7ec5127f78dbec68de4dc8337. * Correctly debounce onScroll function
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user