mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	added promotedAttributesExpanded option
This commit is contained in:
		| @@ -120,11 +120,11 @@ export default class AttributeListWidget extends TabAwareWidget { | |||||||
|         this.$allAttrWrapper = this.$widget.find('.all-attr-wrapper'); |         this.$allAttrWrapper = this.$widget.find('.all-attr-wrapper'); | ||||||
|  |  | ||||||
|         this.$promotedExpander.on('click', async () => { |         this.$promotedExpander.on('click', async () => { | ||||||
|             if (this.$allAttrWrapper.is(":visible")) { |             const collapse = this.$allAttrWrapper.is(":visible"); | ||||||
|                 this.$allAttrWrapper.slideUp(200); |  | ||||||
|             } else { |             await options.save('promotedAttributesExpanded', !collapse); | ||||||
|                 this.$allAttrWrapper.slideDown(200); |  | ||||||
|             } |             this.triggerEvent(`promotedAttributesCollapsedStateChanged`, {collapse}); | ||||||
|         }); |         }); | ||||||
|  |  | ||||||
|         this.$ownedAndInheritedWrapper = this.$widget.find('.owned-and-inherited-wrapper'); |         this.$ownedAndInheritedWrapper = this.$widget.find('.owned-and-inherited-wrapper'); | ||||||
| @@ -165,7 +165,7 @@ export default class AttributeListWidget extends TabAwareWidget { | |||||||
|         const hasPromotedAttrs = this.promotedAttributesWidget.getPromotedAttributes().length > 0; |         const hasPromotedAttrs = this.promotedAttributesWidget.getPromotedAttributes().length > 0; | ||||||
|  |  | ||||||
|         if (hasPromotedAttrs) { |         if (hasPromotedAttrs) { | ||||||
|             this.$allAttrWrapper.show(); |             this.$allAttrWrapper.toggle(options.is('promotedAttributesExpanded')); | ||||||
|             this.$ownedAndInheritedWrapper.hide(); |             this.$ownedAndInheritedWrapper.hide(); | ||||||
|             this.$inheritedAttributesWrapper.hide(); |             this.$inheritedAttributesWrapper.hide(); | ||||||
|         } |         } | ||||||
| @@ -240,4 +240,16 @@ export default class AttributeListWidget extends TabAwareWidget { | |||||||
|             this.$ownedAndInheritedWrapper.slideDown(200); |             this.$ownedAndInheritedWrapper.slideDown(200); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * This event is used to synchronize collapsed state of all the tab-cached widgets since they are all rendered | ||||||
|  |      * separately but should behave uniformly for the user. | ||||||
|  |      */ | ||||||
|  |     promotedAttributesCollapsedStateChangedEvent({collapse}) { | ||||||
|  |         if (collapse) { | ||||||
|  |             this.$allAttrWrapper.slideUp(200); | ||||||
|  |         } else { | ||||||
|  |             this.$allAttrWrapper.slideDown(200); | ||||||
|  |         } | ||||||
|  |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -44,7 +44,7 @@ export default class PromotedAttributesWidget extends TabAwareWidget { | |||||||
|         this.$container.empty(); |         this.$container.empty(); | ||||||
|  |  | ||||||
|         const promotedAttributes = this.getPromotedAttributes(); |         const promotedAttributes = this.getPromotedAttributes(); | ||||||
|         const attributes = note.getAttributes();console.log(this.note.getAttributes()); |         const attributes = note.getAttributes(); | ||||||
|  |  | ||||||
|         const cells = []; |         const cells = []; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -38,7 +38,8 @@ const ALLOWED_OPTIONS = new Set([ | |||||||
|     'leftPaneVisible', |     'leftPaneVisible', | ||||||
|     'rightPaneVisible', |     'rightPaneVisible', | ||||||
|     'nativeTitleBarVisible', |     'nativeTitleBarVisible', | ||||||
|     'attributeListExpanded' |     'attributeListExpanded', | ||||||
|  |     'promotedAttributesExpanded' | ||||||
| ]); | ]); | ||||||
|  |  | ||||||
| function getOptions() { | function getOptions() { | ||||||
|   | |||||||
| @@ -85,7 +85,8 @@ const defaultOptions = [ | |||||||
|     { name: 'eraseNotesAfterTimeInSeconds', value: '604800', isSynced: true }, // default is 7 days |     { name: 'eraseNotesAfterTimeInSeconds', value: '604800', isSynced: true }, // default is 7 days | ||||||
|     { name: 'hideArchivedNotes_main', value: 'false', isSynced: false }, |     { name: 'hideArchivedNotes_main', value: 'false', isSynced: false }, | ||||||
|     { name: 'hideIncludedImages_main', value: 'true', isSynced: false }, |     { name: 'hideIncludedImages_main', value: 'true', isSynced: false }, | ||||||
|     { name: 'attributeListExpanded', value: 'false', isSynced: false } |     { name: 'attributeListExpanded', value: 'false', isSynced: false }, | ||||||
|  |     { name: 'promotedAttributesExpanded', value: 'false', isSynced: true } | ||||||
| ]; | ]; | ||||||
|  |  | ||||||
| function initStartupOptions() { | function initStartupOptions() { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user