Commit 35ee21d9 authored by Mike Greiling's avatar Mike Greiling

remove problematic use of requestAnimationFrame

parent f0a4b487
...@@ -7,10 +7,6 @@ import { emojiMap, emojiAliases, isEmojiNameValid } from './emoji'; ...@@ -7,10 +7,6 @@ import { emojiMap, emojiAliases, isEmojiNameValid } from './emoji';
const animationEndEventString = 'animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd'; const animationEndEventString = 'animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd';
const transitionEndEventString = 'transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd'; const transitionEndEventString = 'transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd';
const requestAnimationFrame = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.setTimeout;
const FROM_SENTENCE_REGEX = /(?:, and | and |, )/; // For separating lists produced by ruby's Array#toSentence const FROM_SENTENCE_REGEX = /(?:, and | and |, )/; // For separating lists produced by ruby's Array#toSentence
...@@ -74,9 +70,7 @@ export default class AwardsHandler { ...@@ -74,9 +70,7 @@ export default class AwardsHandler {
this.registerEventListener('one', $(document), 'mouseenter focus', '.js-add-award', 'mouseenter focus', () => { this.registerEventListener('one', $(document), 'mouseenter focus', '.js-add-award', 'mouseenter focus', () => {
const $menu = $('.emoji-menu'); const $menu = $('.emoji-menu');
if ($menu.length === 0) { if ($menu.length === 0) {
requestAnimationFrame(() => { setTimeout(() => this.createEmojiMenu());
this.createEmojiMenu();
});
} }
// Prebuild the categoryMap // Prebuild the categoryMap
categoryMap = categoryMap || buildCategoryMap(); categoryMap = categoryMap || buildCategoryMap();
...@@ -221,7 +215,7 @@ export default class AwardsHandler { ...@@ -221,7 +215,7 @@ export default class AwardsHandler {
categoryLabelMap[categoryNameKey], categoryLabelMap[categoryNameKey],
emojisInCategory, emojisInCategory,
); );
requestAnimationFrame(() => { setTimeout(() => {
emojiContentElement.insertAdjacentHTML('beforeend', categoryMarkup); emojiContentElement.insertAdjacentHTML('beforeend', categoryMarkup);
resolve(); resolve();
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment