forked from MapComplete/MapComplete
		
	Full code cleanup
This commit is contained in:
		
							parent
							
								
									8e6ee8c87f
								
							
						
					
					
						commit
						bd21212eba
					
				
					 246 changed files with 19418 additions and 11729 deletions
				
			
		|  | @ -18,16 +18,8 @@ export default class Toggle extends VariableUiElement { | |||
|         this.isEnabled = isEnabled | ||||
|     } | ||||
| 
 | ||||
|     public ToggleOnClick(): Toggle { | ||||
|         const self = this; | ||||
|         this.onClick(() => { | ||||
|             self.isEnabled.setData(!self.isEnabled.data); | ||||
|         }) | ||||
|         return this; | ||||
|     } | ||||
| 
 | ||||
|    public static If(condition: UIEventSource<boolean>, constructor: () => BaseUIElement): BaseUIElement { | ||||
|         if(constructor === undefined){ | ||||
|     public static If(condition: UIEventSource<boolean>, constructor: () => BaseUIElement): BaseUIElement { | ||||
|         if (constructor === undefined) { | ||||
|             return undefined | ||||
|         } | ||||
|         return new Toggle( | ||||
|  | @ -35,6 +27,14 @@ export default class Toggle extends VariableUiElement { | |||
|             undefined, | ||||
|             condition | ||||
|         ) | ||||
|          | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     public ToggleOnClick(): Toggle { | ||||
|         const self = this; | ||||
|         this.onClick(() => { | ||||
|             self.isEnabled.setData(!self.isEnabled.data); | ||||
|         }) | ||||
|         return this; | ||||
|     } | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue