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