mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 08:45:50 +01:00
add #shareRoot label to define an "index" note, closes #2567
This commit is contained in:
@@ -32,7 +32,7 @@ export default class SharedInfoWidget extends NoteContextAwareWidget {
|
||||
const syncServerHost = options.get("syncServerHost");
|
||||
let link;
|
||||
|
||||
const shareId = note.getOwnedLabelValue('shareAlias') || note.noteId;
|
||||
const shareId = this.getShareId(note);
|
||||
|
||||
if (syncServerHost) {
|
||||
link = syncServerHost + "/share/" + shareId;
|
||||
@@ -46,6 +46,14 @@ export default class SharedInfoWidget extends NoteContextAwareWidget {
|
||||
this.$sharedLink.attr("href", link).text(link);
|
||||
}
|
||||
|
||||
getShareId(note) {
|
||||
if (note.hasOwnedLabel('shareRoot')) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return note.getOwnedLabelValue('shareAlias') || note.noteId;
|
||||
}
|
||||
|
||||
entitiesReloadedEvent({loadResults}) {
|
||||
if (loadResults.getAttributes().find(attr => attr.name.startsWith("share") && attributeService.isAffecting(attr, this.note))) {
|
||||
this.refresh();
|
||||
|
||||
Reference in New Issue
Block a user