From ec052d1d10e260901805097e341ea438b3560597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 24 May 2013 10:03:11 +0200 Subject: [PATCH] Correctly detect already performed highlighting --- js/functions.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/functions.js b/js/functions.js index c3a9c1ea87..7fdbefe5b6 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1496,13 +1496,14 @@ function PMA_highlightSQL(base) var $elm = base.find('code.sql'); $elm.each(function () { var $sql = $(this); + var $pre = $sql.find('pre'); /* We only care about visible elements to avoid double processing */ - if ($sql.is(":visible")) { + if ($pre.is(":visible")) { var $highlight = $('
'); $sql.append($highlight); console.log('Highlight SQL: ' + $sql.text()); CodeMirror.runMode($sql.text(), 'text/x-mysql', $highlight[0]); - $sql.find('pre').hide(); + $pre.hide(); } }); }