15 lines
480 B
JavaScript
15 lines
480 B
JavaScript
document.addEventListener('DOMContentLoaded', () => {
|
|
const editor = CodeMirror.fromTextArea(document.getElementById('sqlSchemaEditor'), {
|
|
mode: 'text/x-sql',
|
|
theme: 'material',
|
|
lineNumbers: false,
|
|
indentUnit: 2,
|
|
tabSize: 2,
|
|
});
|
|
// Force CodeMirror to refresh when the tab is shown
|
|
const schemaTab = document.querySelector('button[data-bs-target="#schema"]');
|
|
schemaTab.addEventListener('shown.bs.tab', function () {
|
|
editor.refresh();
|
|
});
|
|
});
|