forked from MapComplete/MapComplete
		
	Huge refactoring of state and initial UI setup
This commit is contained in:
		
							parent
							
								
									4e43673de5
								
							
						
					
					
						commit
						eff6b5bfad
					
				
					 37 changed files with 5232 additions and 4907 deletions
				
			
		|  | @ -1,6 +1,7 @@ | |||
| import {UIEventSource} from "../../Logic/UIEventSource"; | ||||
| import BaseUIElement from "../BaseUIElement"; | ||||
| import {VariableUiElement} from "../Base/VariableUIElement"; | ||||
| import Lazy from "../Base/Lazy"; | ||||
| 
 | ||||
| /** | ||||
|  * The 'Toggle' is a UIElement showing either one of two elements, depending on the state. | ||||
|  | @ -24,4 +25,16 @@ export default class Toggle extends VariableUiElement { | |||
|         }) | ||||
|         return this; | ||||
|     } | ||||
| 
 | ||||
|    public static If(condition: UIEventSource<boolean>, constructor: () => BaseUIElement): BaseUIElement { | ||||
|         if(constructor === undefined){ | ||||
|             return undefined | ||||
|         } | ||||
|         return new Toggle( | ||||
|             new Lazy(constructor), | ||||
|             undefined, | ||||
|             condition | ||||
|         ) | ||||
|          | ||||
|     } | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue