diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/slides.js | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/js/slides.js b/js/slides.js index 42d5329..acdbe5b 100644 --- a/js/slides.js +++ b/js/slides.js | |||
@@ -14,9 +14,7 @@ function SlideDeck(el) { | |||
14 | 14 | ||
15 | this.getCurrentSlideFromHash_(); | 15 | this.getCurrentSlideFromHash_(); |
16 | 16 | ||
17 | /*document.addEventListener('DOMContentLoaded', | 17 | // Call this explicitly. Modernizr.load won't be done until after DOM load. |
18 | this.onDomLoaded_.bind(this), false);*/ | ||
19 | // Introducing yepnopejs causes DOMContentLoaded before the deck is setup. | ||
20 | this.onDomLoaded_.bind(this)(); | 18 | this.onDomLoaded_.bind(this)(); |
21 | } | 19 | } |
22 | 20 | ||
@@ -50,12 +48,11 @@ SlideDeck.prototype.getCurrentSlideFromHash_ = function() { | |||
50 | * @private | 48 | * @private |
51 | */ | 49 | */ |
52 | SlideDeck.prototype.onDomLoaded_ = function(e) { | 50 | SlideDeck.prototype.onDomLoaded_ = function(e) { |
53 | // Fade in deck. | 51 | document.body.classList.add('loaded'); // Fade in deck. |
54 | document.body.classList.add('loaded'); | ||
55 | 52 | ||
56 | this.slides = this.container.querySelectorAll('slide:not([hidden]):not(.backdrop)'); | 53 | this.slides = this.container.querySelectorAll('slide:not([hidden]):not(.backdrop)'); |
57 | 54 | ||
58 | // If we're on a smartphone device, load phone.css. | 55 | // If we're on a smartphone, apply special sauce. |
59 | if (Modernizr.mq('only screen and (max-device-width: 480px)')) { | 56 | if (Modernizr.mq('only screen and (max-device-width: 480px)')) { |
60 | // var style = document.createElement('link'); | 57 | // var style = document.createElement('link'); |
61 | // style.rel = 'stylesheet'; | 58 | // style.rel = 'stylesheet'; |
@@ -63,7 +60,7 @@ SlideDeck.prototype.onDomLoaded_ = function(e) { | |||
63 | // style.href = this.CSS_DIR_ + 'phone.css'; | 60 | // style.href = this.CSS_DIR_ + 'phone.css'; |
64 | // document.querySelector('head').appendChild(style); | 61 | // document.querySelector('head').appendChild(style); |
65 | 62 | ||
66 | // Remove widescreen if it's applied. | 63 | // No need for widescreen layout on a phone. |
67 | this.container.classList.remove('layout-widescreen'); | 64 | this.container.classList.remove('layout-widescreen'); |
68 | } | 65 | } |
69 | 66 | ||
@@ -389,10 +386,6 @@ SlideDeck.prototype.prevSlide = function(opt_dontPush) { | |||
389 | bodyClassList.remove('with-notes'); | 386 | bodyClassList.remove('with-notes'); |
390 | } | 387 | } |
391 | 388 | ||
392 | // if (this.controller) { | ||
393 | // this.controller.sendMsg({slideDirection: SlideController.MOVE_LEFT}); | ||
394 | // } | ||
395 | |||
396 | this.prevSlide_ = this.curSlide_; | 389 | this.prevSlide_ = this.curSlide_; |
397 | this.curSlide_--; | 390 | this.curSlide_--; |
398 | 391 | ||
@@ -404,11 +397,6 @@ SlideDeck.prototype.prevSlide = function(opt_dontPush) { | |||
404 | * @param {boolean=} opt_dontPush | 397 | * @param {boolean=} opt_dontPush |
405 | */ | 398 | */ |
406 | SlideDeck.prototype.nextSlide = function(opt_dontPush) { | 399 | SlideDeck.prototype.nextSlide = function(opt_dontPush) { |
407 | // | ||
408 | // if (this.controller) { | ||
409 | // this.controller.sendMsg({slideDirection: SlideController.MOVE_RIGHT}); | ||
410 | // } | ||
411 | |||
412 | if (this.buildNextItem_()) { | 400 | if (this.buildNextItem_()) { |
413 | return; | 401 | return; |
414 | } | 402 | } |