mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Add new th-page-refreshed hook
This commit is contained in:
parent
3f5e8aed3d
commit
de4eb5ca89
@ -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) {
|
||||
|
15
editions/dev/tiddlers/new/Hook_ th-page-refreshed.tid
Normal file
15
editions/dev/tiddlers/new/Hook_ th-page-refreshed.tid
Normal file
@ -0,0 +1,15 @@
|
||||
created: 20180104155916980
|
||||
modified: 20180104160025999
|
||||
tags: HookMechanism
|
||||
title: Hook: th-page-refreshed
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
This hook notifies plugins that a page refresh has just occurred. It is typically used to apply post-rendering effects.
|
||||
|
||||
Hook function parameters:
|
||||
|
||||
* (none)
|
||||
|
||||
Return value:
|
||||
|
||||
* (none)
|
Loading…
Reference in New Issue
Block a user