mirror of
https://github.com/zadam/trilium.git
synced 2025-11-15 09:45:52 +01:00
refactoring of legacy js events
This commit is contained in:
@@ -15,7 +15,7 @@ class AttributesWidget extends StandardWidget {
|
||||
|
||||
getHeaderActions() {
|
||||
const $showFullButton = $("<a>").append("show dialog").addClass('widget-header-action');
|
||||
$showFullButton.click(async () => {
|
||||
$showFullButton.on('click', async () => {
|
||||
const attributesDialog = await import("../dialogs/attributes.js");
|
||||
attributesDialog.showDialog();
|
||||
});
|
||||
@@ -43,7 +43,7 @@ class AttributesWidget extends StandardWidget {
|
||||
const $showInheritedAttributes = $("<a>")
|
||||
.attr("href", "javascript:")
|
||||
.text("+show inherited")
|
||||
.click(() => {
|
||||
.on('click', () => {
|
||||
$showInheritedAttributes.hide();
|
||||
$inheritedAttrs.show();
|
||||
});
|
||||
@@ -51,7 +51,7 @@ class AttributesWidget extends StandardWidget {
|
||||
const $hideInheritedAttributes = $("<a>")
|
||||
.attr("href", "javascript:")
|
||||
.text("-hide inherited")
|
||||
.click(() => {
|
||||
.on('click', () => {
|
||||
$showInheritedAttributes.show();
|
||||
$inheritedAttrs.hide();
|
||||
});
|
||||
|
||||
@@ -49,13 +49,13 @@ class CalendarWidget extends StandardWidget {
|
||||
this.$next = $el.find('[data-calendar-toggle="next"]');
|
||||
this.$previous = $el.find('[data-calendar-toggle="previous"]');
|
||||
|
||||
this.$next.click(() => {
|
||||
this.$next.on('click', () => {
|
||||
this.clearCalendar();
|
||||
this.date.setMonth(this.date.getMonth() + 1);
|
||||
this.createMonth();
|
||||
});
|
||||
|
||||
this.$previous.click(() => {
|
||||
this.$previous.on('click', () => {
|
||||
this.clearCalendar();
|
||||
this.date.setMonth(this.date.getMonth() - 1);
|
||||
this.createMonth();
|
||||
|
||||
@@ -20,7 +20,7 @@ class LinkMapWidget extends StandardWidget {
|
||||
|
||||
getHeaderActions() {
|
||||
const $showFullButton = $("<a>").append("show full").addClass('widget-header-action');
|
||||
$showFullButton.click(async () => {
|
||||
$showFullButton.on('click', async () => {
|
||||
const linkMapDialog = await import("../dialogs/link_map.js");
|
||||
linkMapDialog.showDialog();
|
||||
});
|
||||
|
||||
@@ -18,7 +18,7 @@ class NoteRevisionsWidget extends StandardWidget {
|
||||
|
||||
getHeaderActions() {
|
||||
const $showFullButton = $("<a>").append("show dialog").addClass('widget-header-action');
|
||||
$showFullButton.click(async () => {
|
||||
$showFullButton.on('click', async () => {
|
||||
const attributesDialog = await import("../dialogs/note_revisions.js");
|
||||
attributesDialog.showCurrentNoteRevisions(this.ctx.note.noteId);
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ class WhatLinksHereWidget extends StandardWidget {
|
||||
|
||||
getHeaderActions() {
|
||||
const $showFullButton = $("<a>").append("show link map").addClass('widget-header-action');
|
||||
$showFullButton.click(async () => {
|
||||
$showFullButton.on('click', async () => {
|
||||
const linkMapDialog = await import("../dialogs/link_map.js");
|
||||
linkMapDialog.showDialog();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user