diff options
author | Wu Cheng-Han | 2016-08-15 11:28:48 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2016-08-15 11:28:48 +0800 |
commit | 29d198def9e4d0c930625d646567e84cc81e512c (patch) | |
tree | f9c447561ac99a8de2c8fadd7eb1e9e4803b316b | |
parent | 8124d6f2d66ca95a87419c1c78a2050e5deaaf4b (diff) |
Update slide ready and change event to improve performance
Diffstat (limited to '')
-rw-r--r-- | public/js/slide.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/public/js/slide.js b/public/js/slide.js index e45f78a6..bdd8b3be 100644 --- a/public/js/slide.js +++ b/public/js/slide.js @@ -98,12 +98,15 @@ function renderSlide(event) { markdown.attr('data-rendered', 'true'); document.title = title; Reveal.layout(); - // force browser redraw - setTimeout(function () { - markdown.hide().show(0); - }, 0); } } -Reveal.addEventListener('ready', renderSlide); -Reveal.addEventListener('slidechanged', renderSlide);
\ No newline at end of file +Reveal.addEventListener('ready', function (event) { + renderSlide(event); + var markdown = $(event.currentSlide); + // force browser redraw + setTimeout(function () { + markdown.hide().show(0); + }, 0); +}); +Reveal.addEventListener('slidechanged', renderSlide); |