mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-10-31 07:32:59 +00:00 
			
		
		
		
	Add support for th-navigating event
				
					
				
			This commit is contained in:
		| @@ -174,6 +174,7 @@ NavigatorWidget.prototype.addToHistory = function(title,fromPageRect) { | |||||||
| Handle a tm-navigate event | Handle a tm-navigate event | ||||||
| */ | */ | ||||||
| NavigatorWidget.prototype.handleNavigateEvent = function(event) { | NavigatorWidget.prototype.handleNavigateEvent = function(event) { | ||||||
|  | 	event = $tw.hooks.invokeHook("th-navigating",event); | ||||||
| 	if(event.navigateTo) { | 	if(event.navigateTo) { | ||||||
| 		this.addToStory(event.navigateTo,event.navigateFromTitle); | 		this.addToStory(event.navigateTo,event.navigateFromTitle); | ||||||
| 		if(!event.navigateSuppressNavigation) { | 		if(!event.navigateSuppressNavigation) { | ||||||
|   | |||||||
							
								
								
									
										19
									
								
								editions/dev/tiddlers/new/Hook__th-navigating.tid
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								editions/dev/tiddlers/new/Hook__th-navigating.tid
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | |||||||
|  | created: 20170219130829546 | ||||||
|  | modified: 20170219145518777 | ||||||
|  | tags: HookMechanism | ||||||
|  | title: Hook: th-navigating | ||||||
|  | type: text/vnd.tiddlywiki | ||||||
|  |  | ||||||
|  | This hook allows plugins to monitor and modify navigation events. | ||||||
|  |  | ||||||
|  | Hook function parameters: | ||||||
|  |  | ||||||
|  | * ''event'': object describing the navigation event: | ||||||
|  | ** ''event.navigateTo'': title of target tiddler | ||||||
|  | ** ''event.navigateFromTitle'': title of tiddler containing the | ||||||
|  | ** ''event.navigateSuppressNavigation'': boolean; when true the target tiddler opens without the usual scrolling | ||||||
|  | ** ''event.navigateFromClientRect'': rectange in client coordinates of the DOM node triggering the navigation | ||||||
|  |  | ||||||
|  | Return value: | ||||||
|  |  | ||||||
|  | * possibly modified event object | ||||||
		Reference in New Issue
	
	Block a user
	 Jermolene
					Jermolene