aboutsummaryrefslogtreecommitdiff
path: root/js/slide-deck.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/slide-deck.js')
-rw-r--r--js/slide-deck.js41
1 files changed, 23 insertions, 18 deletions
diff --git a/js/slide-deck.js b/js/slide-deck.js
index 61fe1c0..559b761 100644
--- a/js/slide-deck.js
+++ b/js/slide-deck.js
@@ -315,7 +315,9 @@ SlideDeck.prototype.loadConfig_ = function(config) {
315 315
316 // Prettyprint. Default to on. 316 // Prettyprint. Default to on.
317 if (!!!('usePrettify' in settings) || settings.usePrettify) { 317 if (!!!('usePrettify' in settings) || settings.usePrettify) {
318 prettyPrint(); 318 require([ 'prettify' ], function() {
319 prettyPrint();
320 });
319 } 321 }
320 322
321 if (settings.analytics) { 323 if (settings.analytics) {
@@ -423,24 +425,27 @@ SlideDeck.prototype.loadConfig_ = function(config) {
423 e.preventDefault(); 425 e.preventDefault();
424 }, false); 426 }, false);
425 427
426 var hammer = new Hammer(this.container); 428 require([ 'hammer' ], function() {
427 hammer.ondragend = function(e) { 429 var hammer = new Hammer(this.container);
428 var evt = document.createEvent('Event'); 430 hammer.ondragend = function(e) {
429 evt.initEvent('keydown', true, true); 431 var evt = document.createEvent('Event');
430 432 evt.initEvent('keydown', true, true);
431 switch (e.direction) { 433
432 case 'right': 434 switch (e.direction) {
433 // previous slide 435 case 'right':
434 evt.keyCode = 37; 436 // previous slide
435 break; 437 evt.keyCode = 37;
436 case 'left': 438 break;
437 // next slide 439 case 'left':
438 evt.keyCode = 39; 440 // next slide
439 break; 441 evt.keyCode = 39;
440 } 442 break;
443 }
444
445 document.dispatchEvent(evt);
446 };
447 });
441 448
442 document.dispatchEvent(evt);
443 };
444 } 449 }
445}; 450};
446 451