mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Fixed local dev env crashing
This commit is contained in:
parent
ea54c073c3
commit
eb10f02e5f
2 changed files with 19 additions and 5 deletions
|
@ -589,6 +589,14 @@ video {
|
|||
padding: 0.8rem;
|
||||
}
|
||||
|
||||
.p-\[calc\(21px\+10\%\)\] {
|
||||
padding: calc(21px + 10%);
|
||||
}
|
||||
|
||||
.p-4 {
|
||||
padding: 1.6rem;
|
||||
}
|
||||
|
||||
.text-xl {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
|
|
@ -7,14 +7,20 @@ const ROOT_DIV_ID = 'ghost-comments-root';
|
|||
function addRootDiv() {
|
||||
const scriptTag = document.querySelector('script[data-ghost-comments]');
|
||||
|
||||
// We need to inject the comment box at the same place as the script tag
|
||||
if (scriptTag) {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
const elem = document.createElement('div');
|
||||
elem.id = ROOT_DIV_ID;
|
||||
scriptTag.parentElement.insertBefore(elem, scriptTag);
|
||||
document.body.appendChild(elem);
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('Comment box location was not found: could not load comments box.');
|
||||
// We need to inject the comment box at the same place as the script tag
|
||||
if (scriptTag) {
|
||||
const elem = document.createElement('div');
|
||||
elem.id = ROOT_DIV_ID;
|
||||
scriptTag.parentElement.insertBefore(elem, scriptTag);
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('Comment box location was not found: could not load comments box.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue