From 46566ffcb65c24ab914c49b95751f84630b125f2 Mon Sep 17 00:00:00 2001 From: nightpool Date: Mon, 12 Mar 2018 18:41:57 -0400 Subject: [PATCH] fix bio length autosizing --- app/javascript/packs/public.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js index bb05435be..f9f83653d 100644 --- a/app/javascript/packs/public.js +++ b/app/javascript/packs/public.js @@ -14,12 +14,6 @@ window.addEventListener('message', e => { id: data.id, height: document.getElementsByTagName('html')[0].scrollHeight, }, '*'); - - if (document.fonts && document.fonts.ready) { - document.fonts.ready.then(sizeBioText); - } else { - sizeBioText(); - } }); }); @@ -85,6 +79,17 @@ function main() { }) .catch(error => console.error(error)); } + + [].forEach.call(document.querySelectorAll('[data-component="Card"]'), (content) => { + const props = JSON.parse(content.getAttribute('data-props')); + ReactDOM.render(, content); + }); + + if (document.fonts && document.fonts.ready) { + document.fonts.ready.then(sizeBioText); + } else { + sizeBioText(); + } }); delegate(document, '.webapp-btn', 'click', ({ target, button }) => {