mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
attribute fixes
This commit is contained in:
parent
eaac65142f
commit
1810116a34
@ -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) {
|
$.fn.setSelectedNotePath = function (notePath) {
|
||||||
notePath = notePath || "";
|
notePath = notePath || "";
|
||||||
|
|
||||||
|
@ -404,6 +404,9 @@ export default class AttributeDetailWidget extends BasicWidget {
|
|||||||
if (this.attrType.endsWith('-definition')) {
|
if (this.attrType.endsWith('-definition')) {
|
||||||
this.attribute.value = this.buildDefinitionValue();
|
this.attribute.value = this.buildDefinitionValue();
|
||||||
}
|
}
|
||||||
|
else if (this.attrType === 'relation') {
|
||||||
|
this.attribute.value = this.$attrInputTargetNote.getSelectedNoteId();
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
this.attribute.value = this.$attrInputValue.val();
|
this.attribute.value = this.$attrInputValue.val();
|
||||||
}
|
}
|
||||||
|
@ -80,9 +80,8 @@ const mentionSetup = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
itemRenderer: item => {
|
itemRenderer: item => {
|
||||||
const itemElement = document.createElement('span');
|
const itemElement = document.createElement('button');
|
||||||
|
|
||||||
itemElement.classList.add('mentions-item');
|
|
||||||
itemElement.innerHTML = `${item.highlightedNotePathTitle} `;
|
itemElement.innerHTML = `${item.highlightedNotePathTitle} `;
|
||||||
|
|
||||||
return itemElement;
|
return itemElement;
|
||||||
|
@ -30,9 +30,8 @@ const mentionSetup = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
itemRenderer: item => {
|
itemRenderer: item => {
|
||||||
const itemElement = document.createElement('span');
|
const itemElement = document.createElement('button');
|
||||||
|
|
||||||
itemElement.classList.add('mentions-item');
|
|
||||||
itemElement.innerHTML = `${item.highlightedNotePathTitle} `;
|
itemElement.innerHTML = `${item.highlightedNotePathTitle} `;
|
||||||
|
|
||||||
return itemElement;
|
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;
|
color: var(--main-text-color) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mentions-item {
|
.ck-mentions .ck-button {
|
||||||
font-size: var(--main-font-size) !important;
|
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;
|
background-color: var(--active-item-background-color) !important;
|
||||||
color: var(--active-item-text-color) !important;
|
color: var(--active-item-text-color) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mentions-item b {
|
.ck-mentions .ck-button b {
|
||||||
font-weight: bold !important;
|
font-weight: bold !important;
|
||||||
color: inherit !important;
|
color: inherit !important;
|
||||||
vertical-align: baseline !important;
|
vertical-align: baseline !important;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user