From a958759cb1389459fa23f680f38fc3dd388d9e77 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Mon, 11 Dec 2017 14:56:50 +0100 Subject: [PATCH] Fix utils.slideUp() and utils.slideDown() in IE9 IE9 doesn't support sliding, but also doesn't support requestAnimationFrame(). Use setTimeout() with a delay of 16ms (1000ms / 60fps = 16.67ms) instead. This isn't optimal, but who cares about IE9... This is also true for IE8, even though we don't officially support it. --- js/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/utils.js b/js/utils.js index 3b48911..09e3432 100644 --- a/js/utils.js +++ b/js/utils.js @@ -35,7 +35,7 @@ utils.slideUp = function (element, finishCallback, startCallback) if (!utils.canSlide()) { if (startCallback) startCallback(); element.className += (element.className !== '') ? ' hidden' : 'hidden'; - if (finishCallback) window.requestAnimationFrame(finishCallback); + if (finishCallback) window.setTimeout(finishCallback, 16); return; } @@ -83,7 +83,7 @@ utils.slideDown = function (element, finishCallback, startCallback) if (!utils.canSlide()) { if (startCallback) startCallback(); element.className = element.className.replace(/\bhidden\b */g, ''); - if (finishCallback) window.requestAnimationFrame(finishCallback); + if (finishCallback) window.setTimeout(finishCallback, 16); return; }