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

This reverts commit 8b426431a41ad6e91de05614a2d35d48c5112fa7.
This commit is contained in:
Roman Rizzi
2020-12-10 16:48:25 -03:00
committed by GitHub
parent b24a77ff91
commit aa0d4ea764
50 changed files with 354 additions and 518 deletions

View File

@ -6,7 +6,7 @@ import I18n from "I18n";
import { INPUT_DELAY } from "discourse-common/config/environment";
import { Promise } from "rsvp";
import { cookAsync } from "discourse/lib/text";
import discourseDebounce from "discourse-common/lib/debounce";
import discourseDebounce from "discourse/lib/debounce";
import { isEmpty } from "@ember/utils";
import loadScript from "discourse/lib/load-script";
import { notEmpty } from "@ember/object/computed";
@ -56,24 +56,18 @@ export default Component.extend({
},
@observes("markup")
_renderPreview() {
discourseDebounce(
this,
function () {
const markup = this.markup;
_renderPreview: discourseDebounce(function () {
const markup = this.markup;
if (markup) {
cookAsync(markup).then((result) => {
this.set("currentPreview", result);
schedule("afterRender", () =>
this.$(".preview .discourse-local-date").applyLocalDates()
);
});
}
},
INPUT_DELAY
);
},
if (markup) {
cookAsync(markup).then((result) => {
this.set("currentPreview", result);
schedule("afterRender", () =>
this.$(".preview .discourse-local-date").applyLocalDates()
);
});
}
}, INPUT_DELAY),
@computed("date", "toDate", "toTime")
isRange(date, toDate, toTime) {