Commit 8d275e6d authored by Paul Slaughter's avatar Paul Slaughter

Move requestAnimationFrame fallback to own module

parent b03b414c
......@@ -10,14 +10,10 @@ import { isInVueNoteablePage } from './lib/utils/dom_utils';
import flash from './flash';
import axios from './lib/utils/axios_utils';
import * as Emoji from '~/emoji';
import requestAnimationFrame from '~/lib/utils/request_animation_frame_fallback';
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
......
/**
* DO NOT USE!
*
* This is a module meant to encapsulate a legacy bit of calculation so that it can
* be easily mocked in Jest to fix performance and degredation issues.
*/
export default window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.setTimeout;
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