Fix preview button on new article

This commit is contained in:
Gabriel Augendre 2021-03-21 16:37:16 +01:00
parent 63e7118a9b
commit 5657109aa2

View file

@ -2,7 +2,9 @@ let preview = null;
window.onload = function () {
const previewButton = document.querySelector("input#_live_preview");
previewButton.addEventListener("click", openPreviewPopup);
if (previewButton) {
previewButton.addEventListener("click", openPreviewPopup);
}
};
window.onbeforeunload = function () {
if (preview !== null) {