From 093a9ef7cf845b5056ba7e504a73757daf5f0ee2 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sat, 7 Mar 2015 19:47:48 +0100 Subject: When changing page, emptying page content before loading the other page --- router.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/router.js b/router.js index 84c8ab1..234c50b 100644 --- a/router.js +++ b/router.js @@ -29,7 +29,10 @@ function router() { var url = location.hash.slice(2) || 'presentation'; var contentElement = document.getElementById('content'); + contentElement.style.height = contentElement.offsetHeight + 'px'; + contentElement.innerHTML = ''; fetchFile('Pages/' + url + '.md', function(contentMd) { + contentElement.style.height = 'auto'; contentElement.innerHTML = markdown.toHTML(contentMd); }, function() { var notFoundPage = '

Page non trouvée

Retour à l\'accueil'; -- cgit v1.2.3