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 () { window.onload = function () {
const previewButton = document.querySelector("input#_live_preview"); const previewButton = document.querySelector("input#_live_preview");
if (previewButton) {
previewButton.addEventListener("click", openPreviewPopup); previewButton.addEventListener("click", openPreviewPopup);
}
}; };
window.onbeforeunload = function () { window.onbeforeunload = function () {
if (preview !== null) { if (preview !== null) {