1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-24 06:13:17 +00:00

Fix rootwidget handling

This commit is contained in:
Jermolene 2014-08-13 20:20:58 +01:00
parent 7c1cb97f7f
commit 449edf99b5
3 changed files with 13 additions and 11 deletions

View File

@ -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() {

View File

@ -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);

View File

@ -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