diff options
author | Joris Guyonvarch | 2015-03-07 19:47:48 +0100 |
---|---|---|
committer | Joris Guyonvarch | 2015-03-07 19:47:48 +0100 |
commit | 093a9ef7cf845b5056ba7e504a73757daf5f0ee2 (patch) | |
tree | 0325d95ff0cb0e51c88cd69cf68a0ab07448f7fc | |
parent | a57a8b1fa57b885c7e852cd9a9ebcc23b19ba840 (diff) |
When changing page, emptying page content before loading the other page
-rw-r--r-- | router.js | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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>'; |