off by one error

pull/1/head
ansuz 8 years ago
parent 809919cb32
commit 55b1a17b0d

@ -40,7 +40,7 @@ define([
var update = Slide.update = function (content) { var update = Slide.update = function (content) {
if (!Slide.shown) { return; } if (!Slide.shown) { return; }
console.log(content); console.log(content);
Slide.content = content.split(/\n\-\-\-\n/).filter(truthy); Slide.content = content.split(/\n\s*\-\-\-\s*\n/).filter(truthy);
draw(Slide.index); draw(Slide.index);
}; };
@ -52,7 +52,7 @@ define([
var right = Slide.right = function () { var right = Slide.right = function () {
console.log('right'); console.log('right');
var i = Slide.index = Math.min(Slide.content.length, Slide.index + 1); var i = Slide.index = Math.min(Slide.content.length -1, Slide.index + 1);
Slide.draw(i); Slide.draw(i);
}; };
@ -62,6 +62,7 @@ define([
case 37: case 37:
Slide.left(); Slide.left();
break; break;
case 32:
case 39: // right case 39: // right
Slide.right(); Slide.right();
break; break;

Loading…
Cancel
Save