Fix slide mode on print pdf not finish view rendering

This commit is contained in:
Wu Cheng-Han 2016-12-18 22:53:31 +08:00
parent 3eb2159ded
commit 1892fe70f6

View file

@ -107,6 +107,13 @@ window.viewAjaxCallback = function () {
};
function renderSlide(event) {
if (window.location.search.match( /print-pdf/gi )) {
var slides = $('.slides');
var title = document.title;
finishView(slides);
document.title = title;
Reveal.layout();
} else {
var markdown = $(event.currentSlide);
if (!markdown.attr('data-rendered')) {
var title = document.title;
@ -116,6 +123,7 @@ function renderSlide(event) {
Reveal.layout();
}
}
}
Reveal.addEventListener('ready', function (event) {
renderSlide(event);