mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 13:01:31 +08:00 
			
		
		
		
	disable toggling navigation buttons because of rare performance issues
This commit is contained in:
		
							parent
							
								
									172f3689fa
								
							
						
					
					
						commit
						2823bf3488
					
				| @ -1,9 +1,7 @@ | |||||||
| import BasicWidget from "./basic_widget.js"; | import BasicWidget from "./basic_widget.js"; | ||||||
| import utils from "../services/utils.js"; | import utils from "../services/utils.js"; | ||||||
| import keyboardActionService from "../services/keyboard_actions.js"; |  | ||||||
| import contextMenu from "../services/context_menu.js"; | import contextMenu from "../services/context_menu.js"; | ||||||
| import treeService from "../services/tree.js"; | import treeService from "../services/tree.js"; | ||||||
| import appContext from "../services/app_context.js"; |  | ||||||
| 
 | 
 | ||||||
| const TPL = ` | const TPL = ` | ||||||
| <div class="history-navigation"> | <div class="history-navigation"> | ||||||
| @ -21,7 +19,11 @@ const TPL = ` | |||||||
| 
 | 
 | ||||||
| export default class HistoryNavigationWidget extends BasicWidget { | export default class HistoryNavigationWidget extends BasicWidget { | ||||||
|     doRender() { |     doRender() { | ||||||
|         if (utils.isElectron()) { |         if (!utils.isElectron()) { | ||||||
|  |             this.$widget = $("<div>"); | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         this.$widget = $(TPL); |         this.$widget = $(TPL); | ||||||
|         this.contentSized(); |         this.contentSized(); | ||||||
| 
 | 
 | ||||||
| @ -49,10 +51,6 @@ export default class HistoryNavigationWidget extends BasicWidget { | |||||||
| 
 | 
 | ||||||
|         this.refresh(); |         this.refresh(); | ||||||
|     } |     } | ||||||
|         else { |  | ||||||
|             this.$widget = $("<div>"); |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     async showContextMenu(e) { |     async showContextMenu(e) { | ||||||
|         let items = []; |         let items = []; | ||||||
| @ -93,8 +91,11 @@ export default class HistoryNavigationWidget extends BasicWidget { | |||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         this.$backInHistory.toggleClass('disabled', !this.webContents.canGoBack()); |         // disabling this because in electron 9 there's weird performance problem which makes these webContents calls
 | ||||||
|         this.$forwardInHistory.toggleClass('disabled', !this.webContents.canGoForward()); |         // block UI thread for > 1 second on specific notes (book notes displaying underlying render notes with scripts)
 | ||||||
|  | 
 | ||||||
|  |         // this.$backInHistory.toggleClass('disabled', !this.webContents.canGoBack());
 | ||||||
|  |         // this.$forwardInHistory.toggleClass('disabled', !this.webContents.canGoForward());
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     activeNoteChangedEvent() { |     activeNoteChangedEvent() { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam