From d2e29e3a9e05afb4fd194d6c3ecb8576edfb9f32 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 6 Jul 2020 15:28:13 -0400 Subject: [PATCH] force-redraw slides when markdown plugins finish loading --- www/slide/slide.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/www/slide/slide.js b/www/slide/slide.js index 64c0910d2..d11246d6e 100644 --- a/www/slide/slide.js +++ b/www/slide/slide.js @@ -154,18 +154,22 @@ define([ updateFontSize(); }; - Slide.update = function (content) { + Slide.update = function (content, force) { updateFontSize(); if (!content) { content = ''; } var old = Slide.content; Slide.content = content.replace(/\n\s*\-\-\-\s*\n/g, '\n\n'+separator+'\n\n'); - if (old !== Slide.content) { + if (force || old !== Slide.content) { draw(Slide.index); return; } change(Slide.lastIndex, Slide.index); }; + DiffMd.onPluginLoaded(function () { + Slide.update(Slide.content, true); + }); + Slide.left = function () { console.log('left'); Slide.lastIndex = Slide.index;