kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Fix problem with displaying modals before the page container is initialised
rodzic
854a9d6d1c
commit
1f21bd36d6
|
@ -100,17 +100,6 @@ exports.startup = function() {
|
||||||
$tw.anim = new $tw.utils.Animator();
|
$tw.anim = new $tw.utils.Animator();
|
||||||
// Kick off the stylesheet manager
|
// Kick off the stylesheet manager
|
||||||
$tw.stylesheetManager = new $tw.utils.StylesheetManager($tw.wiki);
|
$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
|
// Display the PageTemplate
|
||||||
var templateTitle = "$:/core/ui/PageTemplate",
|
var templateTitle = "$:/core/ui/PageTemplate",
|
||||||
parser = $tw.wiki.parseTiddler(templateTitle),
|
parser = $tw.wiki.parseTiddler(templateTitle),
|
||||||
|
@ -123,6 +112,17 @@ exports.startup = function() {
|
||||||
$tw.wiki.addEventListener("change",function(changes) {
|
$tw.wiki.addEventListener("change",function(changes) {
|
||||||
renderTree.refreshInDom(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 {
|
} else {
|
||||||
// On the server, start a commander with the command line arguments
|
// On the server, start a commander with the command line arguments
|
||||||
commander = new $tw.Commander(
|
commander = new $tw.Commander(
|
||||||
|
|
Ładowanie…
Reference in New Issue