Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-06-24 02:52:30 +0300
committerMike Greiling <mike@pixelcog.com>2017-06-26 22:10:01 +0300
commit35ee21d992a8d2fa65ee7601c8948dbf79b54c53 (patch)
treea6cab9343445811a0fa7f20f31194e1851e52631 /app/assets/javascripts/awards_handler.js
parentf0a4b4875ff5c558c8420dd75c7130e1510e07f8 (diff)
remove problematic use of requestAnimationFrame
Diffstat (limited to 'app/assets/javascripts/awards_handler.js')
-rw-r--r--app/assets/javascripts/awards_handler.js10
1 files changed, 2 insertions, 8 deletions
diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js
index b6a12d09042..2bae4f4d955 100644
--- a/app/assets/javascripts/awards_handler.js
+++ b/app/assets/javascripts/awards_handler.js
@@ -7,10 +7,6 @@ import { emojiMap, emojiAliases, isEmojiNameValid } from './emoji';
const animationEndEventString = 'animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd';
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
@@ -74,9 +70,7 @@ export default class AwardsHandler {
this.registerEventListener('one', $(document), 'mouseenter focus', '.js-add-award', 'mouseenter focus', () => {
const $menu = $('.emoji-menu');
if ($menu.length === 0) {
- requestAnimationFrame(() => {
- this.createEmojiMenu();
- });
+ setTimeout(() => this.createEmojiMenu());
}
// Prebuild the categoryMap
categoryMap = categoryMap || buildCategoryMap();
@@ -221,7 +215,7 @@ export default class AwardsHandler {
categoryLabelMap[categoryNameKey],
emojisInCategory,
);
- requestAnimationFrame(() => {
+ setTimeout(() => {
emojiContentElement.insertAdjacentHTML('beforeend', categoryMarkup);
resolve();
});