Fix crash in optional components. Now does less; we should rethink this once title etc stabilize.

This commit is contained in:
Ludwig Schubert
2017-10-10 12:29:59 -07:00
parent 75e132e77f
commit 044acd8f03
+9 -9
View File
@@ -9,13 +9,13 @@
export default function(dom, data) {
const article = dom.querySelector('d-article');
const abstract = dom.querySelector('d-abstract');
// const abstract = dom.querySelector('d-abstract');
let interstitial = dom.querySelector('d-interstitial');
if (!interstitial && data.password) {
interstitial = dom.createElement('d-interstitial');
interstitial.password = data.password;
dom.body.insertBefore(interstitial, article);
dom.body.insertBefore(interstitial, dom.body.firstChild);
}
// let h1 = dom.querySelector('h1');
@@ -24,13 +24,13 @@ export default function(dom, data) {
// data.title = h1.textContent;
// }
// } else {
if (data.title) {
let headline = dom.createElement('d-title');
let h1 = dom.createElement('h1');
headline.appendChild(h1);
h1.textContent = data.title;
abstract.parentNode.insertBefore(headline, abstract);
}
// if (data.title) {
// let headline = dom.createElement('d-title');
// let h1 = dom.createElement('h1');
// headline.appendChild(h1);
// h1.textContent = data.title;
// abstract.parentNode.insertBefore(headline, abstract);
// }
// if (data.description) {
// const h2 = dom.createElement('h2');
// h2.textContent = data.description;