Skip to content

Commit 086a065

Browse files
authored
Merge pull request #201 from iamgio/slides-live-preview-fix
fix(live-preview): fix live preview refreshing to the wrong slide in slides documents
2 parents bdb2a04 + 0b49ead commit 086a065

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

quarkdown-server/src/main/resources/live-preview/wrapper.html.template

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,12 @@
227227
newFrame.contentWindow.onscroll = null;
228228
newFrame.onload = null;
229229

230+
// (#199) If the URL has changed (e.g. different slide, subdocument, etc.), update the hidden frame's URL to match.
231+
const activeUrl = currentFrame.contentWindow.location.href;
232+
if (newFrame.src !== activeUrl) {
233+
newFrame.src = activeUrl;
234+
}
235+
230236
// Swap frame visibility.
231237
setFrameVisibility(newFrame, true);
232238
setFrameVisibility(currentFrame, false);

0 commit comments

Comments
 (0)