mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Comment embeds: fix reflow flicker in firefox
Firefox was returning a height of 0 when an iframe was hidden. This was causing unnecessary reflows when toggling between the options for comment embeds. There doesn't seem to be a good reason to broadcast a 0 height up to the parent window, so i've added a guard for that.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
function checkHeight() {
|
||||
var height = document.body.clientHeight;
|
||||
|
||||
if (App.height !== height) {
|
||||
if (height && App.height !== height) {
|
||||
App.height = height;
|
||||
|
||||
App.postMessage(window.parent, 'resize', height, '*');
|
||||
|
||||
Reference in New Issue
Block a user