mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Fixed announcement bar insertion
no issue - Checked if react root div was already inserted to avoid duplication.
This commit is contained in:
parent
b6320ca976
commit
b893ec13ab
1 changed files with 4 additions and 0 deletions
|
@ -6,6 +6,10 @@ import {App} from './App';
|
|||
const ROOT_DIV_ID = 'announcement-bar-root';
|
||||
|
||||
function addRootDiv() {
|
||||
if (document.getElementById(ROOT_DIV_ID)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const elem = document.createElement('div');
|
||||
elem.id = ROOT_DIV_ID;
|
||||
document.body.prepend(elem);
|
||||
|
|
Loading…
Add table
Reference in a new issue