aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-03-07 19:47:48 +0100
committerJoris Guyonvarch2015-03-07 19:47:48 +0100
commit093a9ef7cf845b5056ba7e504a73757daf5f0ee2 (patch)
tree0325d95ff0cb0e51c88cd69cf68a0ab07448f7fc
parenta57a8b1fa57b885c7e852cd9a9ebcc23b19ba840 (diff)
When changing page, emptying page content before loading the other page
-rw-r--r--router.js3
1 files changed, 3 insertions, 0 deletions
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 = '<h1>Page non trouvée</h1><a href="#">Retour à l\'accueil</a>';