only render preview if preview container is visible

pull/1/head
ansuz 2017-05-24 17:25:33 +02:00
parent 617e027f12
commit 3803f6a20f
1 changed files with 1 additions and 0 deletions

View File

@ -112,6 +112,7 @@ define([
var drawPreview = Cryptpad.throttle(function () {
if (CodeMirror.highlightMode !== 'markdown') { return; }
if (!$previewContainer.is(':visible')) { return; }
try {
DiffMd.apply(DiffMd.render(editor.getValue()), $preview);
} catch (e) { console.error(e); }