diff options
author | Madhura Jayaratne <madhura.cj@gmail.com> | 2015-05-21 07:16:49 +0300 |
---|---|---|
committer | Madhura Jayaratne <madhura.cj@gmail.com> | 2015-05-21 07:16:49 +0300 |
commit | 62f07fef15349c3d2f3fff308649d6b5fa914169 (patch) | |
tree | 31b1767bb662100fae10c489e6c4383a66b473d2 /js/transformations | |
parent | ad289aab6c9e9593a6b00ac8f30f1258109da45d (diff) |
Use a single function to initialize CodeMirror editors
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
Diffstat (limited to 'js/transformations')
-rw-r--r-- | js/transformations/sql_editor.js | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/js/transformations/sql_editor.js b/js/transformations/sql_editor.js index 3c7b305a43..1e402994c3 100644 --- a/js/transformations/sql_editor.js +++ b/js/transformations/sql_editor.js @@ -8,23 +8,8 @@ AJAX.registerOnload('transformations/sql_editor.js', function() { $.each($('textarea.transform_sql_editor'), function (i, e) { var height = $(e).css('height'); - var codemirror_editor = CodeMirror.fromTextArea(e, { - lineNumbers: true, - matchBrackets: true, - extraKeys: {"Ctrl-Space": "autocomplete"}, - hintOptions: {"completeSingle": false, "completeOnSingleClick": true}, - indentUnit: 4, - mode: "text/x-mysql", - lineWrapping: true - }); - codemirror_editor.on("inputRead", codemirrorAutocompleteOnInputRead); + var codemirror_editor = PMA_getSQLEditor($(e)); codemirror_editor.getScrollerElement().style.height = height; codemirror_editor.refresh(); - codemirror_editor.focus(); - $(codemirror_editor.getWrapperElement()).bind( - 'keydown', - catchKeypressesFromSqlTextboxes - ); }); - }); |