mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 13:01:31 +08:00 
			
		
		
		
	fixes
This commit is contained in:
		
							parent
							
								
									a679fedb58
								
							
						
					
					
						commit
						8ca9ad3497
					
				| @ -10,6 +10,7 @@ import Layout from "../widgets/layout.js"; | |||||||
| import TabManager from "./tab_manager.js"; | import TabManager from "./tab_manager.js"; | ||||||
| import treeService from "./tree.js"; | import treeService from "./tree.js"; | ||||||
| import Component from "../widgets/component.js"; | import Component from "../widgets/component.js"; | ||||||
|  | import keyboardActionsService from "./keyboard_actions.js"; | ||||||
| 
 | 
 | ||||||
| class AppContext extends Component { | class AppContext extends Component { | ||||||
|     constructor(layout) { |     constructor(layout) { | ||||||
| @ -34,6 +35,8 @@ class AppContext extends Component { | |||||||
|         const rootWidget = this.layout.getRootWidget(this); |         const rootWidget = this.layout.getRootWidget(this); | ||||||
|         const $renderedWidget = rootWidget.render(); |         const $renderedWidget = rootWidget.render(); | ||||||
| 
 | 
 | ||||||
|  |         keyboardActionsService.updateDisplayedShortcuts($renderedWidget); | ||||||
|  | 
 | ||||||
|         $("body").append($renderedWidget); |         $("body").append($renderedWidget); | ||||||
| 
 | 
 | ||||||
|         $renderedWidget.on('click', "[data-trigger-event]", e => { |         $renderedWidget.on('click', "[data-trigger-event]", e => { | ||||||
|  | |||||||
| @ -123,6 +123,5 @@ export default { | |||||||
| 	triggerAction, | 	triggerAction, | ||||||
| 	getAction, | 	getAction, | ||||||
| 	updateDisplayedShortcuts, | 	updateDisplayedShortcuts, | ||||||
| 	getActionsForScope, |  | ||||||
| 	setupActionsForElement | 	setupActionsForElement | ||||||
| }; | }; | ||||||
| @ -8,8 +8,6 @@ class BasicWidget extends Component { | |||||||
|         $widget.addClass('component') |         $widget.addClass('component') | ||||||
|             .prop('component', this); |             .prop('component', this); | ||||||
| 
 | 
 | ||||||
|         keyboardActionsService.updateDisplayedShortcuts($widget); |  | ||||||
| 
 |  | ||||||
|         this.toggle(this.isEnabled()); |         this.toggle(this.isEnabled()); | ||||||
| 
 | 
 | ||||||
|         return $widget; |         return $widget; | ||||||
|  | |||||||
| @ -15,6 +15,7 @@ import RelationMapTypeWidget from "./type_widgets/relation_map.js"; | |||||||
| import ProtectedSessionTypeWidget from "./type_widgets/protected_session.js"; | import ProtectedSessionTypeWidget from "./type_widgets/protected_session.js"; | ||||||
| import BookTypeWidget from "./type_widgets/book.js"; | import BookTypeWidget from "./type_widgets/book.js"; | ||||||
| import appContext from "../services/app_context.js"; | import appContext from "../services/app_context.js"; | ||||||
|  | import keyboardActionsService from "../services/keyboard_actions.js"; | ||||||
| 
 | 
 | ||||||
| const TPL = ` | const TPL = ` | ||||||
| <div class="note-detail"> | <div class="note-detail"> | ||||||
| @ -86,7 +87,11 @@ export default class NoteDetailWidget extends TabAwareWidget { | |||||||
|         return this.$widget; |         return this.$widget; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     async refresh() { |     isEnabled() { | ||||||
|  |         return this.tabContext && this.tabContext.isActive(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     async refresh() {console.log("REFRESH DETAIL"); | ||||||
|         if (!this.isEnabled()) { |         if (!this.isEnabled()) { | ||||||
|             this.toggle(false); |             this.toggle(false); | ||||||
|             return; |             return; | ||||||
| @ -103,7 +108,11 @@ export default class NoteDetailWidget extends TabAwareWidget { | |||||||
|             typeWidget.spacedUpdate = this.spacedUpdate; |             typeWidget.spacedUpdate = this.spacedUpdate; | ||||||
| 
 | 
 | ||||||
|             this.children.push(typeWidget); |             this.children.push(typeWidget); | ||||||
|             this.$widget.append(typeWidget.render()); | 
 | ||||||
|  |             const $renderedWidget = typeWidget.render(); | ||||||
|  |             keyboardActionsService.updateDisplayedShortcuts($renderedWidget); | ||||||
|  | 
 | ||||||
|  |             this.$widget.append($renderedWidget); | ||||||
| 
 | 
 | ||||||
|             typeWidget.handleEvent('setTabContext', {tabContext: this.tabContext}); |             typeWidget.handleEvent('setTabContext', {tabContext: this.tabContext}); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -1,4 +1,5 @@ | |||||||
| import TabAwareWidget from "./tab_aware_widget.js"; | import TabAwareWidget from "./tab_aware_widget.js"; | ||||||
|  | import keyboardActionsService from "../services/keyboard_actions.js"; | ||||||
| 
 | 
 | ||||||
| export default class TabCachingWidget extends TabAwareWidget { | export default class TabCachingWidget extends TabAwareWidget { | ||||||
|     constructor(parent, widgetFactory) { |     constructor(parent, widgetFactory) { | ||||||
| @ -40,7 +41,11 @@ export default class TabCachingWidget extends TabAwareWidget { | |||||||
|         if (!widget) { |         if (!widget) { | ||||||
|             widget = this.widgets[this.tabContext.tabId] = this.widgetFactory(this); |             widget = this.widgets[this.tabContext.tabId] = this.widgetFactory(this); | ||||||
|             this.children.push(widget); |             this.children.push(widget); | ||||||
|             this.$widget.after(widget.render()); | 
 | ||||||
|  |             const $renderedWidget = widget.render(); | ||||||
|  |             keyboardActionsService.updateDisplayedShortcuts($renderedWidget); | ||||||
|  | 
 | ||||||
|  |             this.$widget.after($renderedWidget); | ||||||
| 
 | 
 | ||||||
|             widget.handleEvent('setTabContext', {tabContext: this.tabContext}); |             widget.handleEvent('setTabContext', {tabContext: this.tabContext}); | ||||||
|         } |         } | ||||||
|  | |||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam