refactoring of legacy js events

This commit is contained in:
zadam
2019-11-09 17:39:48 +01:00
parent 179d530ea9
commit 31bcc037f1
39 changed files with 110 additions and 110 deletions

View File

@@ -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();
});

View File

@@ -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();

View File

@@ -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();
});

View File

@@ -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);
});

View File

@@ -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();
});