1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-17 07:47:24 +00:00

Add new th-page-refreshed hook

This commit is contained in:
Jermolene
2018-01-04 16:01:19 +00:00
parent 3f5e8aed3d
commit de4eb5ca89
2 changed files with 17 additions and 0 deletions

View File

@@ -57,6 +57,7 @@ exports.startup = function() {
$tw.utils.addClass($tw.pageContainer,"tc-page-container-wrapper");
document.body.insertBefore($tw.pageContainer,document.body.firstChild);
$tw.pageWidgetNode.render($tw.pageContainer,null);
$tw.hooks.invokeHook("th-page-refreshed");
})();
// Prepare refresh mechanism
var deferredChanges = Object.create(null),
@@ -65,6 +66,7 @@ exports.startup = function() {
// Process the refresh
$tw.pageWidgetNode.refresh(deferredChanges);
deferredChanges = Object.create(null);
$tw.hooks.invokeHook("th-page-refreshed");
}
// Add the change event handler
$tw.wiki.addEventListener("change",$tw.perf.report("mainRefresh",function(changes) {