configure ace with setOptions, get rid of redundant scrollbars

This commit is contained in:
Mario Vavti 2016-11-17 11:11:11 +01:00
parent 0e8b13841a
commit 89ad259050

View File

@ -218,14 +218,23 @@
}); });
var editor = ace.edit("ace-editor"); var editor = ace.edit("ace-editor");
editor.setTheme("ace/theme/github"); editor.setOptions({
editor.setShowPrintMargin(false); theme: "ace/theme/github",
editor.getSession().setUseWrapMode('free'); mode: "ace/mode/markdown",
editor.getSession().setMode("ace/mode/markdown");
wrap: true,
minLines: 30,
maxLines: Infinity,
printMargin: false,
});
editor.getSession().setValue(window.wiki_page_content); editor.getSession().setValue(window.wiki_page_content);
window.editor = editor; // Store the editor in the window object so the anonymous function can use it. window.editor = editor; // Store the editor in the window object so the anonymous function can use it.
$('#edit-pane-tab').click(function (ev) {
setTimeout(function() {window.editor.focus();}, 500); // Return the focus to the editor allowing immediate text entry $('#edit-pane-tab').click(function (ev) {
setTimeout(function() {window.editor.focus();}, 500); // Return the focus to the editor allowing immediate text entry
}); });
$('#wiki-get-preview').click(function (ev) { $('#wiki-get-preview').click(function (ev) {