aboutsummaryrefslogtreecommitdiff
path: root/js/slides.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/slides.js')
-rw-r--r--js/slides.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/js/slides.js b/js/slides.js
index 3f2366b..66aaa51 100644
--- a/js/slides.js
+++ b/js/slides.js
@@ -128,7 +128,10 @@ SlideDeck.prototype.onBodyKeyDown_ = function(e) {
128 break; 128 break;
129 129
130 case 78: // N 130 case 78: // N
131 document.body.classList.toggle('with-notes'); 131 // If this slide contains notes, toggle them.
132 if (this.slides_[this.curSlide_].querySelector('.note')) {
133 document.body.classList.toggle('with-notes');
134 }
132 break; 135 break;
133 136
134 case 27: // ESC 137 case 27: // ESC
@@ -276,6 +279,11 @@ SlideDeck.prototype.buildNextItem_ = function() {
276 */ 279 */
277SlideDeck.prototype.prevSlide = function(opt_dontPush) { 280SlideDeck.prototype.prevSlide = function(opt_dontPush) {
278 if (this.curSlide_ > 0) { 281 if (this.curSlide_ > 0) {
282 // Toggle off speaker notes and/or highlighted code if they're showing.
283 var bodyClassList = document.body.classList;
284 bodyClassList.remove('with-notes');
285 bodyClassList.remove('highlight-code');
286
279 this.prevSlide_ = this.curSlide_; 287 this.prevSlide_ = this.curSlide_;
280 this.curSlide_--; 288 this.curSlide_--;
281 289
@@ -293,6 +301,11 @@ SlideDeck.prototype.nextSlide = function(opt_dontPush) {
293 } 301 }
294 302
295 if (this.curSlide_ < this.slides_.length - 1) { 303 if (this.curSlide_ < this.slides_.length - 1) {
304 // Toggle off speaker notes and/or highlighted code if they're showing.
305 var bodyClassList = document.body.classList;
306 bodyClassList.remove('with-notes');
307 bodyClassList.remove('highlight-code');
308
296 this.prevSlide_ = this.curSlide_; 309 this.prevSlide_ = this.curSlide_;
297 this.curSlide_++; 310 this.curSlide_++;
298 311