Fix preview button on new article
This commit is contained in:
parent
63e7118a9b
commit
5657109aa2
1 changed files with 3 additions and 1 deletions
|
@ -2,7 +2,9 @@ let preview = null;
|
||||||
|
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
const previewButton = document.querySelector("input#_live_preview");
|
const previewButton = document.querySelector("input#_live_preview");
|
||||||
previewButton.addEventListener("click", openPreviewPopup);
|
if (previewButton) {
|
||||||
|
previewButton.addEventListener("click", openPreviewPopup);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
window.onbeforeunload = function () {
|
window.onbeforeunload = function () {
|
||||||
if (preview !== null) {
|
if (preview !== null) {
|
||||||
|
|
Reference in a new issue