mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
add help button to attachment list
This commit is contained in:
@@ -332,17 +332,22 @@ function initHelpDropdown($el) {
|
||||
|
||||
const wikiBaseUrl = "https://github.com/zadam/trilium/wiki/";
|
||||
|
||||
function openHelp(e) {
|
||||
window.open(wikiBaseUrl + $(e.target).attr("data-help-page"), '_blank');
|
||||
function openHelp($button) {
|
||||
const helpPage = $button.attr("data-help-page");
|
||||
|
||||
if (helpPage) {
|
||||
const url = wikiBaseUrl + helpPage;
|
||||
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
}
|
||||
|
||||
function initHelpButtons($el) {
|
||||
// for some reason, the .on(event, listener, handler) does not work here (e.g. Options -> Sync -> Help button)
|
||||
// so we do it manually
|
||||
$el.on("click", e => {
|
||||
if ($(e.target).attr("data-help-page")) {
|
||||
openHelp(e);
|
||||
}
|
||||
const $helpButton = $(e.target).closest("[data-help-page]");
|
||||
openHelp($helpButton);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user