rewrite the other events
This commit is contained in:
		
							parent
							
								
									be0f4334f7
								
							
						
					
					
						commit
						777191a27c
					
				
					 1 changed files with 9 additions and 20 deletions
				
			
		|  | @ -23,21 +23,8 @@ class Page_Settings extends Page { | ||||||
| 	@param {object} window the window | 	@param {object} window the window | ||||||
| 	*/ | 	*/ | ||||||
| 	events() { | 	events() { | ||||||
| 		if (document.querySelector(`[data-action="filters,update"]`)) { | 		(document.querySelector(`[data-action="filters,update"]`)) | ||||||
| 			document | 			? document.querySelector(`[data-action="filters,update"]`).addEventListener(`click`, async () => { | ||||||
| 				.querySelector(`[data-action="filters,update"]`) |  | ||||||
| 				.addEventListener(`click`, async () => { |  | ||||||
| 					let filters = new ( |  | ||||||
| 						await import(chrome.runtime.getURL(`scripts/filters.js`)) |  | ||||||
| 					).default(); |  | ||||||
| 					filters.update(); |  | ||||||
| 				}); |  | ||||||
| 		} |  | ||||||
| 	 |  | ||||||
| 		if (document.querySelector(`[data-action="filters,add,one"]`)) { |  | ||||||
| 			document |  | ||||||
| 				.querySelector(`[data-action="filters,add,one"]`) |  | ||||||
| 				.addEventListener(`click`, async () => { |  | ||||||
| 					// Import the filters module.
 | 					// Import the filters module.
 | ||||||
| 					this.data.filters = (this.data.filters) ? this.data.filters : new filters(); | 					this.data.filters = (this.data.filters) ? this.data.filters : new filters(); | ||||||
| 
 | 
 | ||||||
|  | @ -102,9 +89,11 @@ class Page_Settings extends Page { | ||||||
| 				}) | 				}) | ||||||
| 			: false;		 | 			: false;		 | ||||||
| 
 | 
 | ||||||
| 		(document.querySelectorAll(`[data-action]`)).forEach((ELEMENT) => { | 		(document.querySelectorAll(`[data-action]`))  | ||||||
|  | 			? (document.querySelectorAll(`[data-action]`)).forEach((ELEMENT) => { | ||||||
| 				ELEMENT.removeAttribute(`data-action`); | 				ELEMENT.removeAttribute(`data-action`); | ||||||
| 			}) | 			}) | ||||||
|  | 			: false; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue