mirror of
				https://github.com/flynx/pWiki.git
				synced 2025-10-31 11:00:08 +00:00 
			
		
		
		
	tweaking and minor tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									811ed21223
								
							
						
					
					
						commit
						901683bcca
					
				| @ -2093,7 +2093,8 @@ object.Constructor('pWikiPageElement', Page, { | ||||
| 
 | ||||
| 	// XXX CACHE...
 | ||||
| 	__last_refresh_location: undefined, | ||||
| 	refresh: async function(full=false){ | ||||
| 	refresh: types.event.Event('refresh',  | ||||
| 		async function(full=false){ | ||||
| 			// drop cache if re-refreshing or when full refresh requested...
 | ||||
| 			// XXX CACHE...
 | ||||
| 			;(full | ||||
| @ -2107,7 +2108,7 @@ object.Constructor('pWikiPageElement', Page, { | ||||
| 				filter | ||||
| 					&& filter.call(this, dom) } | ||||
| 			this.trigger('onLoad') | ||||
| 		return this }, | ||||
| 			return this }), | ||||
| 
 | ||||
| 	// handle dom as first argument...
 | ||||
| 	__init__: function(dom, ...args){ | ||||
|  | ||||
							
								
								
									
										15
									
								
								pwiki2.html
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								pwiki2.html
									
									
									
									
									
								
							| @ -374,6 +374,7 @@ var logTime = async function(promise, msg=''){ | ||||
| REFRESH_DELAY = 20 | ||||
| 
 | ||||
| var refresh = async function(){ | ||||
| 	pwiki.__prev_path = pwiki.path | ||||
| 	startSpinner() | ||||
| 	setTimeout(function(){ | ||||
| 		logTime( | ||||
| @ -381,6 +382,9 @@ var refresh = async function(){ | ||||
| 			pwiki.location) }, REFRESH_DELAY) } | ||||
| 
 | ||||
| 
 | ||||
| history.scrollRestoration = 'manual' | ||||
| 
 | ||||
| 
 | ||||
| // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  | ||||
| // start loading pWiki... | ||||
| require(['./browser'], function(browser){  | ||||
| @ -425,6 +429,7 @@ require(['./browser'], function(browser){ | ||||
| 
 | ||||
| 	pwiki | ||||
| 		.onBeforeNavigate(function(){ | ||||
| 			this.__prev_path = this.path | ||||
| 			saveAll() }) | ||||
| 		.navigate(async function(){ | ||||
| 			// NOTE: we do not need to directly update location.hash here as | ||||
| @ -471,11 +476,11 @@ require(['./browser'], function(browser){ | ||||
| 					.querySelector('#'+ this.hash) | ||||
| 					.scrollIntoView()  | ||||
| 				// restore history position... | ||||
| 				// XXX HACK this will work only on full page... | ||||
| 				: (document.scrollingElement.scrollTop = this.__scroll ?? 0) | ||||
| 
 | ||||
| 			// XXX MediumEditor... | ||||
| 			//setupMediumEditor() | ||||
| 				// NOTE: only on navigate to new page... | ||||
| 				// XXX HACK this will work only on full page pWiki and  | ||||
| 				//		not on a element/nested pWiki... | ||||
| 				: (this.__prev_path != this.path  | ||||
| 					&& (document.scrollingElement.scrollTop = this.__scroll ?? 0)) | ||||
| 
 | ||||
| 			// handle refresh... | ||||
| 			// NOTE: we need to do this as hashchange is only triggered  | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user