mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 04:51:31 +08:00 
			
		
		
		
	smaller fixes
This commit is contained in:
		
							parent
							
								
									48a7c0235f
								
							
						
					
					
						commit
						3f0974d3d2
					
				| @ -88,6 +88,12 @@ class AttributesWidget extends StandardWidget { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     toggle(show) { | ||||||
|  |         console.trace("attributes toggle", show); | ||||||
|  | 
 | ||||||
|  |         super.toggle(show); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     syncDataListener({data}) { |     syncDataListener({data}) { | ||||||
|         if (data.find(sd => sd.entityName === 'attributes' && sd.noteId === this.tabContext.note.noteId)) { |         if (data.find(sd => sd.entityName === 'attributes' && sd.noteId === this.tabContext.note.noteId)) { | ||||||
|             // no need to invalidate attributes since the Attribute class listens to this as well
 |             // no need to invalidate attributes since the Attribute class listens to this as well
 | ||||||
|  | |||||||
| @ -10,8 +10,6 @@ class BasicWidget extends Component { | |||||||
|         $widget.find("[data-trigger-event]").on('click', e => { |         $widget.find("[data-trigger-event]").on('click', e => { | ||||||
|             const eventName = $(e.target).attr('data-trigger-event'); |             const eventName = $(e.target).attr('data-trigger-event'); | ||||||
| 
 | 
 | ||||||
|             console.log("Triggering " + eventName); |  | ||||||
| 
 |  | ||||||
|             this.appContext.trigger(eventName); |             this.appContext.trigger(eventName); | ||||||
|         }); |         }); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -36,9 +36,10 @@ export default class NoteDetailWidget extends TabAwareWidget { | |||||||
|         this.typeWidgetPromises = {}; |         this.typeWidgetPromises = {}; | ||||||
| 
 | 
 | ||||||
|         this.spacedUpdate = new SpacedUpdate(async () => { |         this.spacedUpdate = new SpacedUpdate(async () => { | ||||||
|             const {noteFull} = this.tabContext; |             const {noteFull, note} = this.tabContext; | ||||||
|             const {noteId} = this.tabContext.note; |             const {noteId} = note; | ||||||
| 
 | 
 | ||||||
|  |             // FIXME hack
 | ||||||
|             const dto = note.dto; |             const dto = note.dto; | ||||||
|             dto.content = noteFull.content = this.getTypeWidget().getContent(); |             dto.content = noteFull.content = this.getTypeWidget().getContent(); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| import TabAwareWidget from "./tab_aware_widget.js"; | import TabAwareWidget from "./tab_aware_widget.js"; | ||||||
| 
 | 
 | ||||||
| const TPL = ` | const TPL = ` | ||||||
| <div> | <div style="display: inline-flex;"> | ||||||
|     <button class="btn btn-sm icon-button bx bx-play-circle render-button" |     <button class="btn btn-sm icon-button bx bx-play-circle render-button" | ||||||
|             title="Render"></button> |             title="Render"></button> | ||||||
|      |      | ||||||
|  | |||||||
| @ -79,19 +79,12 @@ class StandardWidget extends TabAwareWidget { | |||||||
|         this.$headerActions = this.$widget.find('.widget-header-actions'); |         this.$headerActions = this.$widget.find('.widget-header-actions'); | ||||||
|         this.$headerActions.append(...this.getHeaderActions()); |         this.$headerActions.append(...this.getHeaderActions()); | ||||||
| 
 | 
 | ||||||
|         // actual rendering is async
 |         this.initialized = this.renderBody(); | ||||||
|         this.renderBody(); |  | ||||||
| 
 | 
 | ||||||
|         return this.$widget; |         return this.$widget; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     async renderBody() { |     async renderBody() { | ||||||
|         // if (!this.isExpanded() || this.rendered) {
 |  | ||||||
|         //     return;
 |  | ||||||
|         // }
 |  | ||||||
|         //
 |  | ||||||
|         // this.rendered = true;
 |  | ||||||
| 
 |  | ||||||
|         await this.doRenderBody(); |         await this.doRenderBody(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -37,6 +37,10 @@ export default class TabCachingWidget extends TabAwareWidget { | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         widget.toggle(true); |         widget.toggle(true); | ||||||
|  | 
 | ||||||
|  |         // stop propagation of the event to the children, individual tab widget should not know about tab switching
 | ||||||
|  |         // since they are per-tab
 | ||||||
|  |         return false; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     tabRemovedListener({tabId}) { |     tabRemovedListener({tabId}) { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam