1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 10:07:19 +00:00

Fix problem with displaying modals before the page container is initialised

This commit is contained in:
Jeremy Ruston 2013-06-04 16:22:37 +01:00
parent 854a9d6d1c
commit 1f21bd36d6

View File

@ -100,17 +100,6 @@ exports.startup = function() {
$tw.anim = new $tw.utils.Animator();
// Kick off the stylesheet manager
$tw.stylesheetManager = new $tw.utils.StylesheetManager($tw.wiki);
// If we're being viewed on a data: URI then give instructions for how to save
if(document.location.protocol === "data:") {
$tw.utils.dispatchCustomEvent(document,"tw-modal",{
param: "$:/messages/SaveInstructions"
});
} else if($tw.wiki.countTiddlers() === 0){
// Otherwise, if give instructions if this is an empty TiddlyWiki
$tw.utils.dispatchCustomEvent(document,"tw-modal",{
param: "$:/messages/GettingStarted"
});
}
// Display the PageTemplate
var templateTitle = "$:/core/ui/PageTemplate",
parser = $tw.wiki.parseTiddler(templateTitle),
@ -123,6 +112,17 @@ exports.startup = function() {
$tw.wiki.addEventListener("change",function(changes) {
renderTree.refreshInDom(changes);
});
// If we're being viewed on a data: URI then give instructions for how to save
if(document.location.protocol === "data:") {
$tw.utils.dispatchCustomEvent(document,"tw-modal",{
param: "$:/messages/SaveInstructions"
});
} else if($tw.wiki.countTiddlers() === 0){
// Otherwise, if give instructions if this is an empty TiddlyWiki
$tw.utils.dispatchCustomEvent(document,"tw-modal",{
param: "$:/messages/GettingStarted"
});
}
} else {
// On the server, start a commander with the command line arguments
commander = new $tw.Commander(