mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
REFACTOR: Use imports for Ember.run
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { later } from "@ember/runloop";
|
||||
let timeout;
|
||||
const loadingQueue = [];
|
||||
let localCache = {};
|
||||
@@ -82,7 +83,7 @@ function loadNext(ajax) {
|
||||
}
|
||||
)
|
||||
.finally(() => {
|
||||
timeout = Ember.run.later(() => loadNext(ajax), timeoutMs);
|
||||
timeout = later(() => loadNext(ajax), timeoutMs);
|
||||
if (removeLoading) {
|
||||
$elem.removeClass(LOADING_ONEBOX_CSS_CLASS);
|
||||
$elem.data("onebox-loaded");
|
||||
@@ -129,7 +130,7 @@ export function load({
|
||||
if (synchronous) {
|
||||
return loadNext(ajax);
|
||||
} else {
|
||||
timeout = timeout || Ember.run.later(() => loadNext(ajax), 150);
|
||||
timeout = timeout || later(() => loadNext(ajax), 150);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { debounce } from "@ember/runloop";
|
||||
let _cache = {};
|
||||
|
||||
export function lookupCachedUploadUrl(shortUrl) {
|
||||
@@ -100,7 +101,7 @@ export function resolveAllShortUrls(ajax) {
|
||||
$shortUploadUrls = $(attributes);
|
||||
if ($shortUploadUrls.length > 0) {
|
||||
// this is carefully batched so we can do a leading debounce (trigger right away)
|
||||
return Ember.run.debounce(
|
||||
return debounce(
|
||||
null,
|
||||
() => _loadShortUrls($shortUploadUrls, ajax),
|
||||
450,
|
||||
|
||||
Reference in New Issue
Block a user