mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-23 15:36:52 +00:00
Added optional help link to modal messages
This commit is contained in:
parent
d21a70f085
commit
5cb834784a
@ -25,8 +25,9 @@ Modal.prototype.display = function(title) {
|
|||||||
headerTitle = document.createElement("h1"),
|
headerTitle = document.createElement("h1"),
|
||||||
modalBody = document.createElement("div"),
|
modalBody = document.createElement("div"),
|
||||||
modalFooter = document.createElement("div"),
|
modalFooter = document.createElement("div"),
|
||||||
modalFooterHelp = document.createElement("div"),
|
modalFooterHelp = document.createElement("span"),
|
||||||
modalFooterButtons = document.createElement("div");
|
modalFooterButtons = document.createElement("span"),
|
||||||
|
tiddler = this.wiki.getTiddler(title);
|
||||||
// Add classes
|
// Add classes
|
||||||
$tw.utils.addClass(modalBackdrop,"modal-backdrop");
|
$tw.utils.addClass(modalBackdrop,"modal-backdrop");
|
||||||
$tw.utils.addClass(modalWrapper,"modal");
|
$tw.utils.addClass(modalWrapper,"modal");
|
||||||
@ -57,6 +58,14 @@ Modal.prototype.display = function(title) {
|
|||||||
bodyRenderer.refreshInDom(changes);
|
bodyRenderer.refreshInDom(changes);
|
||||||
});
|
});
|
||||||
// Render the footer of the message
|
// Render the footer of the message
|
||||||
|
if(tiddler && tiddler.fields && tiddler.fields.help) {
|
||||||
|
var link = document.createElement("a");
|
||||||
|
link.setAttribute("href",tiddler.fields.help);
|
||||||
|
link.setAttribute("target","_blank");
|
||||||
|
link.appendChild(document.createTextNode("Help"));
|
||||||
|
modalFooterHelp.appendChild(link);
|
||||||
|
modalFooterHelp.style.float = "left";
|
||||||
|
}
|
||||||
var footerRenderer = this.wiki.parseText("text/x-tiddlywiki-run","<<view footer wikified>>");
|
var footerRenderer = this.wiki.parseText("text/x-tiddlywiki-run","<<view footer wikified>>");
|
||||||
footerRenderer.execute([],title);
|
footerRenderer.execute([],title);
|
||||||
footerRenderer.renderInDom(modalFooterButtons);
|
footerRenderer.renderInDom(modalFooterButtons);
|
||||||
|
Loading…
Reference in New Issue
Block a user