render header and footer only once. fixes #788
This commit is contained in:
parent
94714ecb62
commit
3e6a88d31d
3 changed files with 52 additions and 36 deletions
|
@ -2,7 +2,7 @@ const html = require('choo/html');
|
|||
const assets = require('../../../common/assets');
|
||||
|
||||
module.exports = function(state) {
|
||||
return html`<footer class="footer">
|
||||
const footer = html`<footer class="footer">
|
||||
<div class="legalSection">
|
||||
<a
|
||||
href="https://www.mozilla.org"
|
||||
|
@ -61,4 +61,11 @@ module.exports = function(state) {
|
|||
</a>
|
||||
</div>
|
||||
</footer>`;
|
||||
// HACK
|
||||
// We only want to render this once because we
|
||||
// toggle the targets of the links with utils/openLinksInNewTab
|
||||
footer.isSameNode = function(target) {
|
||||
return target && target.nodeName && target.nodeName === 'FOOTER';
|
||||
};
|
||||
return footer;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue