mirror of
https://github.com/discourse/discourse.git
synced 2025-03-28 19:25:55 +08:00
reduce emoji loading threshold
This commit is contained in:
parent
62604e9297
commit
0c9ea1aaf2
@ -282,7 +282,7 @@ export default Ember.Component.extend({
|
|||||||
|
|
||||||
_bindSectionsScroll() {
|
_bindSectionsScroll() {
|
||||||
$list.on("scroll", () => {
|
$list.on("scroll", () => {
|
||||||
Ember.run.debounce(this, this._checkVisibleSection, 500);
|
Ember.run.debounce(this, this._checkVisibleSection, 150);
|
||||||
Ember.run.debounce(this, this._storeScrollPosition, 100);
|
Ember.run.debounce(this, this._storeScrollPosition, 100);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -334,7 +334,7 @@ export default Ember.Component.extend({
|
|||||||
if(preloadedSection && !preloadedSection.$section.hasClass("loaded")) {
|
if(preloadedSection && !preloadedSection.$section.hasClass("loaded")) {
|
||||||
preloadedSection.$section.addClass("loaded");
|
preloadedSection.$section.addClass("loaded");
|
||||||
const $visibleEmojis = preloadedSection.$section.find(".emoji[src='']");
|
const $visibleEmojis = preloadedSection.$section.find(".emoji[src='']");
|
||||||
Ember.run.later(this, () => this._loadVisibleEmojis($visibleEmojis), 3000);
|
Ember.run.later(this, () => this._loadVisibleEmojis($visibleEmojis), 1500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -508,7 +508,12 @@ export default Ember.Component.extend({
|
|||||||
$icon.parent().attr("title"),
|
$icon.parent().attr("title"),
|
||||||
diversity || $icon.hasClass("diversity")
|
diversity || $icon.hasClass("diversity")
|
||||||
);
|
);
|
||||||
$icon.attr("src", "");
|
|
||||||
|
// force visual reloading if needed
|
||||||
|
if($icon.attr("src") !== "") {
|
||||||
|
$icon.attr("src", "");
|
||||||
|
}
|
||||||
|
|
||||||
$icon.attr("src", emojiUrlFor(code));
|
$icon.attr("src", emojiUrlFor(code));
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user