From abbade96afa0f0f2fe6b5a1644458b5b191a5f7e Mon Sep 17 00:00:00 2001 From: azivner Date: Tue, 13 Nov 2018 22:14:41 +0100 Subject: [PATCH] added hidePromotedAttributes label, fixes #221 --- src/public/javascripts/services/attributes.js | 7 +++++-- .../javascripts/services/note_detail_relation_map.js | 4 +--- src/services/attributes.js | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/public/javascripts/services/attributes.js b/src/public/javascripts/services/attributes.js index 07c796a40..e0de78f14 100644 --- a/src/public/javascripts/services/attributes.js +++ b/src/public/javascripts/services/attributes.js @@ -26,7 +26,8 @@ async function getAttributes() { async function showAttributes() { $promotedAttributesContainer.empty(); - $attributeList.hide().empty(); + $attributeList.hide(); + $attributeListInner.empty(); const note = noteDetailService.getCurrentNote(); @@ -37,7 +38,9 @@ async function showAttributes() { && !attr.name.startsWith("child:") && attr.value.isPromoted); - if (promoted.length > 0) { + const hidePromotedAttributes = attributes.some(attr => attr.type === 'label' && attr.name === 'hidePromotedAttributes'); + + if (promoted.length > 0 && !hidePromotedAttributes) { const $tbody = $(""); for (const definitionAttr of promoted) { diff --git a/src/public/javascripts/services/note_detail_relation_map.js b/src/public/javascripts/services/note_detail_relation_map.js index 4846b41c3..d763f026f 100644 --- a/src/public/javascripts/services/note_detail_relation_map.js +++ b/src/public/javascripts/services/note_detail_relation_map.js @@ -528,9 +528,7 @@ $centerButton.click(() => { let averageX = totalX / mapData.notes.length; let averageY = totalY / mapData.notes.length; - console.log(averageX, averageY); - - //pzInstance.moveTo(averageX, averageY); + pzInstance.moveTo(averageX, averageY); }); $component.on("drop", dropNoteOntoRelationMapHandler); diff --git a/src/services/attributes.js b/src/services/attributes.js index 39e41f8b2..e863daf63 100644 --- a/src/services/attributes.js +++ b/src/services/attributes.js @@ -16,6 +16,7 @@ const BUILTIN_ATTRIBUTES = [ { type: 'label', name: 'disableInclusion' }, { type: 'label', name: 'appCss' }, { type: 'label', name: 'hideChildrenOverview' }, + { type: 'label', name: 'hidePromotedAttributes' }, // relation names { type: 'relation', name: 'runOnNoteView' },