mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-09-04 20:08:02 +00:00
Add support for "before" field on startup modules
This commit is contained in:
11
boot/boot.js
11
boot/boot.js
@@ -1750,6 +1750,7 @@ $tw.boot.executeNextStartupTask = function() {
|
||||
if($tw.boot.isStartupTaskEligible(task)) {
|
||||
// Remove this task from the list
|
||||
$tw.boot.remainingStartupModules.splice(taskIndex,1);
|
||||
console.log("Executing task",task.name);
|
||||
// Execute it
|
||||
if(!$tw.utils.hop(task,"synchronous") || task.synchronous) {
|
||||
task.startup();
|
||||
@@ -1783,6 +1784,16 @@ $tw.boot.isStartupTaskEligible = function(taskModule) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Check that no other outstanding tasks must be executed before this one
|
||||
var name = taskModule.name,
|
||||
remaining = $tw.boot.remainingStartupModules;
|
||||
if(name) {
|
||||
for(t=0; t<remaining.length; t++) {
|
||||
if(remaining[t].before && remaining[t].before.indexOf(name) !== -1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Check that all of the tasks that we must be performed after has been done
|
||||
var after = taskModule.after;
|
||||
if(after) {
|
||||
|
Reference in New Issue
Block a user