Skip to content

Commit

Permalink
Merge pull request #2801 from splitbrain/styling-js-opener
Browse files Browse the repository at this point in the history
Cleanup styling cookie properly to exit preview
  • Loading branch information
splitbrain committed Jun 19, 2019
2 parents 2634b98 + d344c07 commit 0a68cd0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/plugins/styling/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ jQuery(function () {
// reload the main page on close
window.onunload = function(e) {
if(doreload) {
window.opener.DokuCookie.setValue('styling_plugin', 0);
window.opener.document.location.reload();
DokuCookie.setValue('styling_plugin', 0);
if(window.opener) window.opener.document.location.reload();
}
return null;
};
Expand All @@ -90,8 +90,8 @@ jQuery(function () {
});

// on first load apply preview
applyPreview(window.opener);
if(window.opener) applyPreview(window.opener);

// enable the preview cookie
window.opener.DokuCookie.setValue('styling_plugin', 1);
DokuCookie.setValue('styling_plugin', 1);
});

0 comments on commit 0a68cd0

Please sign in to comment.