mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-03 22:30:51 +08:00
refactor: 💡 refactor serval event names
refactore serval event names to follow the current usage in repo
This commit is contained in:
parent
a9d8d7d3c5
commit
c9c18146f4
@ -303,9 +303,6 @@ type EventMappings = {
|
|||||||
setNoteContext: {
|
setNoteContext: {
|
||||||
noteContext: NoteContext;
|
noteContext: NoteContext;
|
||||||
};
|
};
|
||||||
noteTypeMimeChangedEvent: {
|
|
||||||
noteId: string;
|
|
||||||
};
|
|
||||||
reEvaluateHighlightsListWidgetVisibility: {
|
reEvaluateHighlightsListWidgetVisibility: {
|
||||||
noteId: string | undefined;
|
noteId: string | undefined;
|
||||||
};
|
};
|
||||||
@ -333,7 +330,7 @@ type EventMappings = {
|
|||||||
noteDetailRefreshed: {
|
noteDetailRefreshed: {
|
||||||
ntxId?: string | null;
|
ntxId?: string | null;
|
||||||
};
|
};
|
||||||
noteContextReorderEvent: {
|
noteContextReorder: {
|
||||||
oldMainNtxId: string;
|
oldMainNtxId: string;
|
||||||
newMainNtxId: string;
|
newMainNtxId: string;
|
||||||
ntxIdsInOrder: string[];
|
ntxIdsInOrder: string[];
|
||||||
|
@ -12,7 +12,7 @@ export default class ClosePaneButton extends OnClickButtonWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async noteContextReorderEvent({ ntxIdsInOrder }: EventData<"noteContextReorderEvent">) {
|
async noteContextReorderEvent({ ntxIdsInOrder }: EventData<"noteContextReorder">) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ export default class CodeButtonsWidget extends NoteContextAwareWidget {
|
|||||||
this.$openTriliumApiDocsButton.toggle(note.mime.startsWith("application/javascript;env="));
|
this.$openTriliumApiDocsButton.toggle(note.mime.startsWith("application/javascript;env="));
|
||||||
}
|
}
|
||||||
|
|
||||||
async noteTypeMimeChangedEvent({ noteId }: EventData<"noteTypeMimeChangedEvent">) {
|
async noteTypeMimeChangedEvent({ noteId }: EventData<"noteTypeMimeChanged">) {
|
||||||
if (this.isNote(noteId)) {
|
if (this.isNote(noteId)) {
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ class NoteContextAwareWidget extends BasicWidget {
|
|||||||
this.noteContext = noteContext;
|
this.noteContext = noteContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
async noteTypeMimeChangedEvent({ noteId }: EventData<"noteTypeMimeChangedEvent">) {
|
async noteTypeMimeChangedEvent({ noteId }: EventData<"noteTypeMimeChanged">) {
|
||||||
if (this.isNote(noteId)) {
|
if (this.isNote(noteId)) {
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
}
|
}
|
||||||
|
@ -638,7 +638,7 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
this.updateTabById(noteContext.mainNtxId || noteContext.ntxId);
|
this.updateTabById(noteContext.mainNtxId || noteContext.ntxId);
|
||||||
}
|
}
|
||||||
|
|
||||||
noteContextReorderEvent({ oldMainNtxId, newMainNtxId }: EventData<"noteContextReorderEvent">) {
|
noteContextReorderEvent({ oldMainNtxId, newMainNtxId }: EventData<"noteContextReorder">) {
|
||||||
if (!oldMainNtxId || !newMainNtxId) {
|
if (!oldMainNtxId || !newMainNtxId) {
|
||||||
// no need to update tab row
|
// no need to update tab row
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user