From 1df11f28139ac2a9d895234c391dfe1f0faa5c43 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 19 Jun 2017 10:26:14 +0200 Subject: [PATCH] Update the font-size when entering/leaving present mode --- www/slide/slide.css | 6 +++--- www/slide/slide.js | 5 +++-- www/slide/slide.less | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/www/slide/slide.css b/www/slide/slide.css index 6bf7e459b..0fcc0951c 100644 --- a/www/slide/slide.css +++ b/www/slide/slide.css @@ -89,7 +89,7 @@ body .CodeMirror-focused .cm-matchhighlight { flex: 1; overflow: hidden; } -.preview .cp div#modal { +.preview .cp div#modal:not(.shown) { position: relative; top: auto; left: auto; @@ -97,10 +97,10 @@ body .CodeMirror-focused .cm-matchhighlight { display: block; height: 100%; } -.preview .cp div#modal #content .slide-container { +.preview .cp div#modal:not(.shown) #content .slide-container { width: 100%; } -.preview .cp div#modal #content .slide-frame { +.preview .cp div#modal:not(.shown) #content .slide-frame { width: 50vw; height: 28.125vw; max-height: 100vh; diff --git a/www/slide/slide.js b/www/slide/slide.js index ed0f0ab2c..fd5277853 100644 --- a/www/slide/slide.js +++ b/www/slide/slide.js @@ -38,7 +38,7 @@ define([ } }; - var updateFontSize = Slide.updateFontSize = function() { + var updateFontSize = Slide.updateFontSize = function () { // 20vh // 20 * 16 / 9vw var wbase = 20; @@ -130,6 +130,7 @@ define([ $pad.addClass('fullscreen'); $('#iframe-container').addClass('fullscreen'); $('.top-bar').hide(); + updateFontSize(); return; } window.location.hash = window.location.hash.replace(/\/present$/, '/'); @@ -140,10 +141,10 @@ define([ $('#iframe-container').removeClass('fullscreen'); $('.top-bar').show(); $modal.removeClass('shown'); + updateFontSize(); }; Slide.update = function (content, init) { - console.log(content, init); updateFontSize(); //if (!init) { return; } if (!content) { content = ''; } diff --git a/www/slide/slide.less b/www/slide/slide.less index 1a6d6e333..ccd4c454d 100644 --- a/www/slide/slide.less +++ b/www/slide/slide.less @@ -97,7 +97,7 @@ body { .preview .cp { flex: 1; overflow: hidden; - div#modal { + div#modal:not(.shown) { position: relative; top: auto; left: auto;