update settings interface events
This commit is contained in:
		
							parent
							
								
									81b61ade1b
								
							
						
					
					
						commit
						8a590a9bad
					
				
					 1 changed files with 20 additions and 9 deletions
				
			
		|  | @ -6,7 +6,6 @@ | ||||||
| import texts from './read.JS'; | import texts from './read.JS'; | ||||||
| import {windowman} from './windowman.JS'; | import {windowman} from './windowman.JS'; | ||||||
| let secretariat = await import(chrome.runtime.getURL("scripts/secretariat.js")); | let secretariat = await import(chrome.runtime.getURL("scripts/secretariat.js")); | ||||||
| // let secretariat = await import(chrome.runtime.getURL("scripts/secretariat.js"));
 |  | ||||||
| 
 | 
 | ||||||
| // Import configuration file.
 | // Import configuration file.
 | ||||||
| // const config = chrome.runtime.getURL('gui/layouts/settings.json');
 | // const config = chrome.runtime.getURL('gui/layouts/settings.json');
 | ||||||
|  | @ -149,25 +148,37 @@ function say() { | ||||||
| 		Arrange the interface. | 		Arrange the interface. | ||||||
| 		*/ | 		*/ | ||||||
| 		function arrange() { | 		function arrange() { | ||||||
| 			let last_opened = secretariat.read(`last`); | 			async function click() { | ||||||
| 			if (!last_opened) {last_opened = 'settings'}; | 				let last_opened = (await Promise.all([secretariat.read([`view`, window.location.href], 1)]))[0]; | ||||||
|  | 				if (!last_opened) {last_opened = 'settings'}; | ||||||
|  | 
 | ||||||
|  | 				document.querySelector(`[role="tab"][for="${last_opened}"]`).click(); | ||||||
|  | 			} | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| 			// click!
 | 			// click!
 | ||||||
| 			document.querySelector(`menu button[role="tab"][aria-controls="${last_opened}"]`).click(); | 			// document.querySelector(`menu button[role="tab"][aria-controls="${last_opened}"]`).click();
 | ||||||
| 
 | 			click(); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | 		/* | ||||||
|  | 		Define the mapping of each button. | ||||||
|  | 		*/ | ||||||
| 		function events() { | 		function events() { | ||||||
| 			 | 			windowman.events(); | ||||||
| 		}; | 		}; | ||||||
| 
 | 
 | ||||||
| 		function main() { | 		function main() { | ||||||
| 			let tab = start(); | 			let tab = start(); | ||||||
| 			say(); | 			say(); | ||||||
|  | 			events(); | ||||||
| 
 | 
 | ||||||
| 			document.addEventListener('DOMContentLoaded', function() { | 			arrange(); | ||||||
| 					arrange(); | 
 | ||||||
| 			}); | 
 | ||||||
|  | 			/*arrange(); | ||||||
|  | 			events();*/ | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		main(); | 		main(); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue