mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
don't short child: promoted attributes
This commit is contained in:
parent
b868990fba
commit
4bc44605fb
@ -226,7 +226,10 @@ async function loadAttributes() {
|
|||||||
|
|
||||||
const attributes = await server.get('notes/' + noteId + '/attributes');
|
const attributes = await server.get('notes/' + noteId + '/attributes');
|
||||||
|
|
||||||
const promoted = attributes.filter(attr => (attr.type === 'label-definition' || attr.type === 'relation-definition') && attr.value.isPromoted);
|
const promoted = attributes.filter(attr =>
|
||||||
|
(attr.type === 'label-definition' || attr.type === 'relation-definition')
|
||||||
|
&& !attr.name.startsWith("child:")
|
||||||
|
&& attr.value.isPromoted);
|
||||||
|
|
||||||
let idx = 1;
|
let idx = 1;
|
||||||
|
|
||||||
|
@ -44,7 +44,10 @@ function setupTooltip() {
|
|||||||
|
|
||||||
async function renderTooltip(callback, note, attributes) {
|
async function renderTooltip(callback, note, attributes) {
|
||||||
let content = '';
|
let content = '';
|
||||||
const promoted = attributes.filter(attr => (attr.type === 'label-definition' || attr.type === 'relation-definition') && attr.value.isPromoted);
|
const promoted = attributes.filter(attr =>
|
||||||
|
(attr.type === 'label-definition' || attr.type === 'relation-definition')
|
||||||
|
&& !attr.name.startsWith("child:")
|
||||||
|
&& attr.value.isPromoted);
|
||||||
|
|
||||||
if (promoted.length > 0) {
|
if (promoted.length > 0) {
|
||||||
const $table = $("<table>").addClass("promoted-attributes-in-tooltip");
|
const $table = $("<table>").addClass("promoted-attributes-in-tooltip");
|
||||||
@ -56,6 +59,10 @@ async function renderTooltip(callback, note, attributes) {
|
|||||||
let valueAttrs = attributes.filter(el => el.name === definitionAttr.name && el.type === valueType);
|
let valueAttrs = attributes.filter(el => el.name === definitionAttr.name && el.type === valueType);
|
||||||
|
|
||||||
for (const valueAttr of valueAttrs) {
|
for (const valueAttr of valueAttrs) {
|
||||||
|
if (!valueAttr.value) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
let $value = "";
|
let $value = "";
|
||||||
|
|
||||||
if (valueType === 'label') {
|
if (valueType === 'label') {
|
||||||
@ -84,8 +91,6 @@ async function renderTooltip(callback, note, attributes) {
|
|||||||
}
|
}
|
||||||
// other types of notes don't have tooltip preview
|
// other types of notes don't have tooltip preview
|
||||||
|
|
||||||
console.log(content);
|
|
||||||
|
|
||||||
if (!content.trim()) {
|
if (!content.trim()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user