mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-03-22 11:26:56 +00:00
Make the tw-home message refresh the page
This commit is contained in:
parent
c4c4c3d270
commit
18f1634802
@ -51,9 +51,8 @@ exports.startup = function() {
|
||||
},false)
|
||||
// Listen for the tw-home message
|
||||
$tw.rootWidget.addEventListener("tw-home",function(event) {
|
||||
var storyFilter = $tw.wiki.getTiddlerText(DEFAULT_TIDDLERS_TITLE),
|
||||
storyList = $tw.wiki.filterTiddlers(storyFilter);
|
||||
$tw.wiki.addTiddler({title: DEFAULT_STORY_TITLE, text: "", list: storyList},$tw.wiki.getModificationFields());
|
||||
window.location.hash = "";
|
||||
window.location.reload(true);
|
||||
});
|
||||
// Listen for the tw-permalink message
|
||||
$tw.rootWidget.addEventListener("tw-permalink",function(event) {
|
||||
|
@ -1,9 +1,9 @@
|
||||
created: 20140312223013470
|
||||
modified: 20140312223134387
|
||||
modified: 20140729223134387
|
||||
tags: message
|
||||
title: WidgetMessage: tw-home
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
The `tw-home` message resets the story list to the tiddlers defined in [[$:/DefaultTiddlers]]. It does not require any properties on the `event` object.
|
||||
The `tw-home` message refreshes the current page by removing any [[permalink|PermaLinks]] from the browser address bar, causing the re-display of the [[$:/DefaultTiddlers]], and re-initialisation of any plugin tiddlers. It does not require any properties on the `event` object.
|
||||
|
||||
The cancel tiddler message is usually generated with the ButtonWidget and is handled by the core.
|
||||
The home message is usually generated with the ButtonWidget and is handled by the core.
|
||||
|
Loading…
x
Reference in New Issue
Block a user