mirror of
https://github.com/zadam/trilium.git
synced 2025-01-16 03:58:53 +08:00
attribute fixes
This commit is contained in:
parent
eaac65142f
commit
1810116a34
5 changed files with 16 additions and 7 deletions
|
@ -120,6 +120,13 @@ function init() {
|
|||
}
|
||||
};
|
||||
|
||||
$.fn.getSelectedNoteId = function () {
|
||||
const notePath = $(this).getSelectedNotePath();
|
||||
const chunks = notePath.split('/');
|
||||
|
||||
return chunks.length >= 1 ? chunks[chunks.length - 1] : null;
|
||||
}
|
||||
|
||||
$.fn.setSelectedNotePath = function (notePath) {
|
||||
notePath = notePath || "";
|
||||
|
||||
|
|
|
@ -404,6 +404,9 @@ export default class AttributeDetailWidget extends BasicWidget {
|
|||
if (this.attrType.endsWith('-definition')) {
|
||||
this.attribute.value = this.buildDefinitionValue();
|
||||
}
|
||||
else if (this.attrType === 'relation') {
|
||||
this.attribute.value = this.$attrInputTargetNote.getSelectedNoteId();
|
||||
}
|
||||
else {
|
||||
this.attribute.value = this.$attrInputValue.val();
|
||||
}
|
||||
|
|
|
@ -80,9 +80,8 @@ const mentionSetup = {
|
|||
});
|
||||
},
|
||||
itemRenderer: item => {
|
||||
const itemElement = document.createElement('span');
|
||||
const itemElement = document.createElement('button');
|
||||
|
||||
itemElement.classList.add('mentions-item');
|
||||
itemElement.innerHTML = `${item.highlightedNotePathTitle} `;
|
||||
|
||||
return itemElement;
|
||||
|
|
|
@ -30,9 +30,8 @@ const mentionSetup = {
|
|||
});
|
||||
},
|
||||
itemRenderer: item => {
|
||||
const itemElement = document.createElement('span');
|
||||
const itemElement = document.createElement('button');
|
||||
|
||||
itemElement.classList.add('mentions-item');
|
||||
itemElement.innerHTML = `${item.highlightedNotePathTitle} `;
|
||||
|
||||
return itemElement;
|
||||
|
|
|
@ -647,16 +647,17 @@ a.external:not(.no-arrow):after, a[href^="http://"]:not(.no-arrow):after, a[href
|
|||
color: var(--main-text-color) !important;
|
||||
}
|
||||
|
||||
.mentions-item {
|
||||
.ck-mentions .ck-button {
|
||||
font-size: var(--main-font-size) !important;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.mentions-item.ck-on {
|
||||
.ck-mentions .ck-button.ck-on {
|
||||
background-color: var(--active-item-background-color) !important;
|
||||
color: var(--active-item-text-color) !important;
|
||||
}
|
||||
|
||||
.mentions-item b {
|
||||
.ck-mentions .ck-button b {
|
||||
font-weight: bold !important;
|
||||
color: inherit !important;
|
||||
vertical-align: baseline !important;
|
||||
|
|
Loading…
Reference in a new issue