Commit 8f753ab7 authored by JC Brand's avatar JC Brand

The `animationend` handler doesn't get be called in chromium

parent 8d69357b
...@@ -37,6 +37,13 @@ ...@@ -37,6 +37,13 @@
'list-multi': 'dropdown' 'list-multi': 'dropdown'
}; };
var afterAnimationEnd = function (el, callback) {
el.classList.remove('visible');
if (_.isFunction(callback)) {
callback();
}
};
var isImage = function (url) { var isImage = function (url) {
var deferred = new $.Deferred(); var deferred = new $.Deferred();
$("<img>", { $("<img>", {
...@@ -219,14 +226,17 @@ ...@@ -219,14 +226,17 @@
} }
return; return;
} }
el.addEventListener("animationend", function () { if (_.includes(el.classList, 'hidden')) {
el.classList.remove('visible'); /* XXX: This doesn't appear to be working...
if (_.isFunction(callback)) { el.addEventListener("webkitAnimationEnd", _.partial(afterAnimationEnd, el, callback), false);
callback(); el.addEventListener("animationend", _.partial(afterAnimationEnd, el, callback), false);
} */
}, false); setTimeout(_.partial(afterAnimationEnd, el, callback), 351);
el.classList.add('visible'); el.classList.add('visible');
el.classList.remove('hidden'); el.classList.remove('hidden');
} else {
afterAnimationEnd(el, callback);
}
}, },
isOTRMessage: function (message) { isOTRMessage: function (message) {
......
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