reduce emoji loading threshold

This commit is contained in:
Joffrey JAFFEUX 2017-07-21 11:46:34 +02:00
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));
}, },
}); });