aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/slide-deck.js41
-rw-r--r--js/slides.js4
2 files changed, 25 insertions, 20 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
diff --git a/js/slides.js b/js/slides.js
index c09d220..c2d0b5c 100644
--- a/js/slides.js
+++ b/js/slides.js
@@ -11,11 +11,11 @@ require.config({
11 11
12 shim : { 12 shim : {
13 'slide-deck' : { 13 'slide-deck' : {
14 deps : ['slide_config', 'slide-controller', 'modernizr', 'hammer'] 14 deps : ['slide_config', 'slide-controller', 'modernizr']
15 } 15 }
16 } 16 }
17}); 17});
18 18
19require(['slide-deck', 'prettify'], function(someModule) { 19require(['slide-deck'], function(someModule) {
20 20
21}); 21});