Update embed.html.erb

Add state descriptor to message being sent to parent window
This commit is contained in:
Christoph Holtermann 2017-10-30 23:17:32 +01:00 committed by Sam
parent f0fc38418c
commit 2244f19ff9
1 changed files with 6 additions and 2 deletions

View File

@ -38,8 +38,12 @@
} }
window.onload = function() { window.onload = function() {
// Send a post message with our loaded height var state = "loading";
postUp({type: 'discourse-resize', height: document['body'].offsetHeight}); if (document.querySelectorAll("a.replies").length > 0) {
var state = "loaded";
}
// Send a post message with our loaded height and state
postUp({type: 'discourse-resize', height: document['body'].offsetHeight, state: state});
var postLinks = document.querySelectorAll("a[data-link-to-post]"), var postLinks = document.querySelectorAll("a[data-link-to-post]"),
i; i;