mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Trigger a reflow on CSS preview so webkit browsers reset animations.
This commit is contained in:
@@ -681,6 +681,10 @@ $.apply_stylesheet = function(cssText) {
|
||||
* that has the old stylesheet, and delete it. Then we add a
|
||||
* <style> with the new one */
|
||||
$("head").children('*[title="' + sheet_title + '"]').remove();
|
||||
|
||||
/* Hack to trigger a reflow so webkit browsers reset animations */
|
||||
document.body.offsetHeight;
|
||||
|
||||
var stylesheet = $('<style type="text/css" media="screen"></style>')
|
||||
.attr('title', sheet_title)
|
||||
.text(cssText)
|
||||
|
||||
Reference in New Issue
Block a user