| 
									
										
										
										
											2021-11-24 21:27:55 +01:00
										 |  |  | import FlexContainer from "./containers/flex_container.js"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export default class NoteWrapperWidget extends FlexContainer { | 
					
						
							|  |  |  |     constructor() { | 
					
						
							|  |  |  |         super('column'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         this.css("flex-grow", "1") | 
					
						
							|  |  |  |             .collapsible(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     doRender() { | 
					
						
							|  |  |  |         super.doRender(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         this.$widget.addClass("note-split"); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     setNoteContextEvent({noteContext}) { | 
					
						
							|  |  |  |         this.refresh(noteContext); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     noteSwitchedAndActivatedEvent({noteContext}) { | 
					
						
							|  |  |  |         this.refresh(noteContext); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     noteSwitchedEvent({noteContext}) { | 
					
						
							|  |  |  |         this.refresh(noteContext); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     activeContextChangedEvent({noteContext}) { | 
					
						
							|  |  |  |         this.refresh(noteContext); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     refresh(noteContext) { | 
					
						
							|  |  |  |         this.$widget.toggleClass("full-content-width", | 
					
						
							| 
									
										
										
										
											2022-04-14 23:09:23 +02:00
										 |  |  |             ['image', 'mermaid', 'book', 'render', 'canvas-note'].includes(noteContext?.note?.type) | 
					
						
							| 
									
										
										
										
											2021-11-24 21:27:55 +01:00
										 |  |  |             || !!noteContext?.note?.hasLabel('fullContentWidth') | 
					
						
							|  |  |  |         ); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |