From 50dc0bd590b79f83cd0d56d4ae66e931f82e7910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 2 Aug 2017 08:33:55 +0200 Subject: [PATCH] Avoid two locations fighting for codemirror_editor variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #13545 Signed-off-by: Michal Čihař --- js/functions.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/functions.js b/js/functions.js index 021f753b3a..9e331e4287 100644 --- a/js/functions.js +++ b/js/functions.js @@ -4632,14 +4632,15 @@ AJAX.registerOnload('functions.js', function () { }); // end $(document).on() } - codemirror_editor = PMA_getSQLEditor($('textarea[name="view[as]"]')); + if ($('textarea[name="view[as]"]').length !== 0) { + codemirror_editor = PMA_getSQLEditor($('textarea[name="view[as]"]')); + } }); function PMA_createViewDialog($this) { var $msg = PMA_ajaxShowMessage(); - var codemirror_editor = null; $.get($this.attr('href') + '&ajax_request=1&ajax_dialog=1', function (data) { if (typeof data !== 'undefined' && data.success === true) { PMA_ajaxRemoveMessage($msg);