forked from MarseyWorld/MarseyWorld
fix reddit embed height on mobile
parent
54a263af02
commit
889624f81d
|
@ -1,7 +1,10 @@
|
|||
addEventListener("message", function(t) {
|
||||
if (typeof t.data == "string" && t.data) {
|
||||
const data = JSON.parse(t.data)
|
||||
let height = data.data
|
||||
if (data && "type" in data && data.type == "resize.embed")
|
||||
document.getElementById('reddit-embed').height = data.data
|
||||
if (screen_width < 768)
|
||||
height += 75
|
||||
document.getElementById('reddit-embed').height = height
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue