Extract ACE editor initialization into separate method

This commit is contained in:
Dan Sosedoff 2014-10-19 09:06:35 -06:00
parent 0c4c34950a
commit 7b93db0760

View File

@ -1,3 +1,5 @@
var editor;
function apiCall(method, path, params, cb) {
$.ajax({
url: path,
@ -247,13 +249,16 @@ function exportToCSV() {
}
}
var editor;
$(document).ready(function() {
function initEditor() {
editor = ace.edit("custom_query");
editor.getSession().setMode("ace/mode/pgsql");
editor.getSession().setTabSize(2);
editor.getSession().setUseSoftTabs(true);
}
$(document).ready(function() {
initEditor();
$("#table_content").on("click", function() { showTableContent(); });
$("#table_structure").on("click", function() { showTableStructure(); });