only render preview if preview container is visible
This commit is contained in:
@@ -112,6 +112,7 @@ define([
|
|||||||
|
|
||||||
var drawPreview = Cryptpad.throttle(function () {
|
var drawPreview = Cryptpad.throttle(function () {
|
||||||
if (CodeMirror.highlightMode !== 'markdown') { return; }
|
if (CodeMirror.highlightMode !== 'markdown') { return; }
|
||||||
|
if (!$previewContainer.is(':visible')) { return; }
|
||||||
try {
|
try {
|
||||||
DiffMd.apply(DiffMd.render(editor.getValue()), $preview);
|
DiffMd.apply(DiffMd.render(editor.getValue()), $preview);
|
||||||
} catch (e) { console.error(e); }
|
} catch (e) { console.error(e); }
|
||||||
|
|||||||
Reference in New Issue
Block a user