diff --git a/core/modules/startup/password.js b/core/modules/startup/password.js index a6d586401..3ff7e26c7 100644 --- a/core/modules/startup/password.js +++ b/core/modules/startup/password.js @@ -15,7 +15,7 @@ Password handling // Export name and synchronous status exports.name = "password"; exports.platforms = ["browser"]; -exports.after = ["rootwidget"]; +exports.after = ["startup"]; exports.synchronous = true; exports.startup = function() { diff --git a/core/modules/startup/rootwidget.js b/core/modules/startup/rootwidget.js index 103b4cf7f..8bce552b5 100644 --- a/core/modules/startup/rootwidget.js +++ b/core/modules/startup/rootwidget.js @@ -15,12 +15,10 @@ Setup the root widget and the core root widget handlers // Export name and synchronous status exports.name = "rootwidget"; exports.platforms = ["browser"]; -exports.after = ["load-modules"]; +exports.after = ["startup"]; exports.before = ["story"]; exports.synchronous = true; -var widget = require("$:/core/modules/widgets/widget.js"); - exports.startup = function() { // Install the modal message mechanism $tw.modal = new $tw.utils.Modal($tw.wiki); diff --git a/core/modules/startup/startup.js b/core/modules/startup/startup.js index e6999da69..6facee2c4 100755 --- a/core/modules/startup/startup.js +++ b/core/modules/startup/startup.js @@ -20,6 +20,8 @@ exports.synchronous = true; // Set to `true` to enable performance instrumentation var PERFORMANCE_INSTRUMENTATION = false; +var widget = require("$:/core/modules/widgets/widget.js"); + exports.startup = function() { var modules,n,m,f; if($tw.browser) { @@ -51,13 +53,15 @@ exports.startup = function() { // Clear outstanding tiddler store change events to avoid an unnecessary refresh cycle at startup $tw.wiki.clearTiddlerEventQueue(); // Create a root widget for attaching event handlers. By using it as the parentWidget for another widget tree, one can reuse the event handlers - $tw.rootWidget = new widget.widget({ - type: "widget", - children: [] - },{ - wiki: $tw.wiki, - document: document - }); + if($tw.browser) { + $tw.rootWidget = new widget.widget({ + type: "widget", + children: [] + },{ + wiki: $tw.wiki, + document: document + }); + } // Set up the syncer object $tw.syncer = new $tw.Syncer({wiki: $tw.wiki}); // Host-specific startup