moved unbinding to an existing element

This commit is contained in:
jous 2013-01-09 15:44:46 +02:00
parent 31154ea501
commit 5a698bc2b4

View File

@ -1320,9 +1320,9 @@ AJAX.registerTeardown('functions.js', function() {
if (codemirror_inline_editor) {
// Copy the sql query to the text area to preserve it.
$('#sql_query_edit').text(codemirror_inline_editor.getValue());
$(codemirror_inline_editor.getWrapperElement()).unbind('keydown');
codemirror_inline_editor.toTextArea();
codemirror_inline_editor = false;
$(codemirror_inline_editor.getWrapperElement()).unbind('keydown');
}
if (codemirror_editor) {
$(codemirror_editor.getWrapperElement()).unbind('keydown');