mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 02:20:41 +08:00
DEV: replaces setTimeout by Ember.run.later (#6618)
This commit is contained in:
parent
f2c227432c
commit
907cf3ee2f
|
@ -40,7 +40,7 @@ export default Ember.Controller.extend({
|
|||
);
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
Ember.run.later(() => {
|
||||
this.set("model.savingStatus", null);
|
||||
}, 2000);
|
||||
|
||||
|
|
|
@ -786,7 +786,7 @@ export default Ember.Component.extend({
|
|||
|
||||
// The paste doesn't finish immediately and we don't have any onpaste
|
||||
// event, so wait for 100ms which _should_ be enough time.
|
||||
setTimeout(() => {
|
||||
Ember.run.later(() => {
|
||||
const pastedImg = contentEditableDiv.find("img");
|
||||
|
||||
if (pastedImg.length === 1) {
|
||||
|
|
|
@ -16,7 +16,7 @@ export default {
|
|||
if (!timeoutIsSet && Discourse.get("requiresRefresh")) {
|
||||
// Since we can do this transparently for people browsing the forum
|
||||
// hold back the message 24 hours.
|
||||
setTimeout(function() {
|
||||
Ember.run.later(() => {
|
||||
bootbox.confirm(I18n.lookup("assets_changed_confirm"), function(
|
||||
result
|
||||
) {
|
||||
|
|
|
@ -114,7 +114,7 @@ export default {
|
|||
}
|
||||
|
||||
// restore href
|
||||
setTimeout(() => {
|
||||
Ember.run.later(() => {
|
||||
$link.removeClass("no-href");
|
||||
$link.attr("href", $link.data("href"));
|
||||
$link.data("href", null);
|
||||
|
|
|
@ -79,7 +79,7 @@ function confirmNotification() {
|
|||
const clickEventHandler = () => notification.close();
|
||||
|
||||
notification.addEventListener("click", clickEventHandler);
|
||||
setTimeout(() => {
|
||||
Ember.run.later(() => {
|
||||
notification.close();
|
||||
notification.removeEventListener("click", clickEventHandler);
|
||||
}, 10 * 1000);
|
||||
|
@ -177,7 +177,7 @@ function onNotification(data) {
|
|||
}
|
||||
|
||||
notification.addEventListener("click", clickEventHandler);
|
||||
setTimeout(function() {
|
||||
Ember.run.later(() => {
|
||||
notification.close();
|
||||
notification.removeEventListener("click", clickEventHandler);
|
||||
}, 10 * 1000);
|
||||
|
|
|
@ -130,9 +130,7 @@ export default {
|
|||
quoteReply() {
|
||||
this.sendToSelectedPost("replyToPost");
|
||||
// lazy but should work for now
|
||||
setTimeout(function() {
|
||||
$(".d-editor .quote").click();
|
||||
}, 500);
|
||||
Ember.run.later(() => $(".d-editor .quote").click(), 500);
|
||||
},
|
||||
|
||||
goToFirstPost() {
|
||||
|
|
|
@ -86,9 +86,7 @@ function positioningWorkaround($fixedElement) {
|
|||
fixedElement.style.top = "";
|
||||
fixedElement.style.height = oldHeight;
|
||||
|
||||
setTimeout(() => {
|
||||
$(fixedElement).removeClass("no-transition");
|
||||
}, 500);
|
||||
Ember.run.later(() => $(fixedElement).removeClass("no-transition"), 500);
|
||||
|
||||
$(window).scrollTop(originalScrollTop);
|
||||
|
||||
|
|
|
@ -395,7 +395,7 @@ export default createWidget("topic-timeline", {
|
|||
const stream = this.attrs.topic.get("postStream");
|
||||
|
||||
// a little debounce to avoid flashing
|
||||
setTimeout(() => {
|
||||
Ember.run.later(() => {
|
||||
if (!this.state.position === pos) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user