add show() to show the context menu without re-defining it
This commit is contained in:
		
							parent
							
								
									db72c0fa36
								
							
						
					
					
						commit
						9b801f33f0
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		|  | @ -29,7 +29,7 @@ export default class Menu { | ||||||
|           }; |           }; | ||||||
|           (this.icon) ? this.#options.icon = this.icon : null; |           (this.icon) ? this.#options.icon = this.icon : null; | ||||||
| 
 | 
 | ||||||
|           chrome.contextMenus.create(this.#options); |           if (!this.#options.hidden) {this.show(); delete this.#options.hidden;}; | ||||||
|           delete this.#options.id; |           delete this.#options.id; | ||||||
|      }; |      }; | ||||||
| 
 | 
 | ||||||
|  | @ -37,6 +37,10 @@ export default class Menu { | ||||||
|           chrome.contextMenus.remove(this.ID); |           chrome.contextMenus.remove(this.ID); | ||||||
|      }; |      }; | ||||||
| 
 | 
 | ||||||
|  |      show() { | ||||||
|  |           chrome.contextMenus.create(this.#options); | ||||||
|  |      } | ||||||
|  | 
 | ||||||
|      /* Update the context menu.  |      /* Update the context menu.  | ||||||
|       |       | ||||||
|      @param {Object} options The new options for the context menu. |      @param {Object} options The new options for the context menu. | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue