summaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
authorWu Cheng-Han2016-08-15 11:28:48 +0800
committerWu Cheng-Han2016-08-15 11:28:48 +0800
commit29d198def9e4d0c930625d646567e84cc81e512c (patch)
treef9c447561ac99a8de2c8fadd7eb1e9e4803b316b /public/js
parent8124d6f2d66ca95a87419c1c78a2050e5deaaf4b (diff)
Update slide ready and change event to improve performance
Diffstat (limited to 'public/js')
-rw-r--r--public/js/slide.js15
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);