|
@@ -35,13 +35,16 @@ $(function() {
|
|
|
editor.getSession().setMode("ace/mode/markdown");
|
|
|
editor.getSession().setUseWrapMode(true);
|
|
|
editor.setShowPrintMargin(true);
|
|
|
-
|
|
|
$.get('/slides.md', function(data) {
|
|
|
editor.setValue(data, -1);
|
|
|
});
|
|
|
-
|
|
|
+ var lastSRow = -1;
|
|
|
ace.edit('editor').getSession().selection.on('changeCursor', function(e) {
|
|
|
var cursorRow = ace.edit('editor').getCursorPosition().row;
|
|
|
+ if(lastSRow === cursorRow){
|
|
|
+ return; // no update
|
|
|
+ }
|
|
|
+ lastSRow = cursorRow;
|
|
|
var currentSlide = currentCursorSlide(cursorRow);
|
|
|
$('#slides-frame')[0].contentWindow.postMessage(JSON.stringify({
|
|
|
method: 'slide',
|