reduce emoji loading threshold

This commit is contained in:
Joffrey JAFFEUX 2017-07-21 11:46:34 +02:00
parent 62604e9297
commit 0c9ea1aaf2
1 changed files with 8 additions and 3 deletions

View File

@ -282,7 +282,7 @@ export default Ember.Component.extend({
_bindSectionsScroll() {
$list.on("scroll", () => {
Ember.run.debounce(this, this._checkVisibleSection, 500);
Ember.run.debounce(this, this._checkVisibleSection, 150);
Ember.run.debounce(this, this._storeScrollPosition, 100);
});
},
@ -334,7 +334,7 @@ export default Ember.Component.extend({
if(preloadedSection && !preloadedSection.$section.hasClass("loaded")) {
preloadedSection.$section.addClass("loaded");
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"),
diversity || $icon.hasClass("diversity")
);
// force visual reloading if needed
if($icon.attr("src") !== "") {
$icon.attr("src", "");
}
$icon.attr("src", emojiUrlFor(code));
},
});