Skip to content

Commit

Permalink
geändert: static/js/index.js
Browse files Browse the repository at this point in the history
	geändert:       static/js/save.js
  • Loading branch information
admini committed Feb 21, 2018
1 parent ebaeea9 commit 8314861
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion static/js/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ $(function() {
});
};

$('#editor').keyup($.debounce(window.save, 300));
$('#editor').keyup($.debounce(window.save, 600));
});

0 comments on commit 8314861

Please sign in to comment.