forked from MapComplete/MapComplete
		
	Butchering the UI framework
This commit is contained in:
		
							parent
							
								
									8d404b1ba9
								
							
						
					
					
						commit
						6415e195d1
					
				
					 90 changed files with 1012 additions and 3101 deletions
				
			
		|  | @ -1,7 +1,7 @@ | |||
| import {UIElement} from "../UIElement"; | ||||
| import {UIEventSource} from "../../Logic/UIEventSource"; | ||||
| import Translations from "../i18n/Translations"; | ||||
| import CheckBox from "../Input/CheckBox"; | ||||
| import Toggle from "../Input/Toggle"; | ||||
| import Combine from "../Base/Combine"; | ||||
| import State from "../../State"; | ||||
| import Svg from "../../Svg"; | ||||
|  | @ -30,7 +30,7 @@ export default class DeleteImage extends UIElement { | |||
|             }); | ||||
| 
 | ||||
|         const cancelButton = Translations.t.general.cancel.SetClass("bg-white pl-4 pr-4").SetStyle( "border-bottom-left-radius:30rem; border-bottom-right-radius: 30rem;"); | ||||
|         this.deleteDialog = new CheckBox( | ||||
|         this.deleteDialog = new Toggle( | ||||
|             new Combine([ | ||||
|                 deleteButton, | ||||
|                 cancelButton | ||||
|  | @ -40,17 +40,17 @@ export default class DeleteImage extends UIElement { | |||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     InnerRender(): string { | ||||
|     InnerRender() { | ||||
|         if(! State.state?.featureSwitchUserbadge?.data){ | ||||
|             return ""; | ||||
|         } | ||||
| 
 | ||||
|         const value = this.tags.data[this.key]; | ||||
|         if (value === undefined || value === "") { | ||||
|             return this.isDeletedBadge.Render(); | ||||
|             return this.isDeletedBadge; | ||||
|         } | ||||
| 
 | ||||
|         return this.deleteDialog.Render(); | ||||
|         return this.deleteDialog; | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  | @ -31,7 +31,7 @@ export class ImageCarousel extends UIElement{ | |||
|             return uiElements; | ||||
|         }); | ||||
| 
 | ||||
|         this.slideshow = new SlideShow(uiElements).HideOnEmpty(true); | ||||
|         this.slideshow = new SlideShow(uiElements); | ||||
|         this.SetClass("block w-full"); | ||||
|         this.slideshow.SetClass("w-full"); | ||||
|     } | ||||
|  |  | |||
|  | @ -9,9 +9,10 @@ import {DropDown} from "../Input/DropDown"; | |||
| import Translations from "../i18n/Translations"; | ||||
| import Svg from "../../Svg"; | ||||
| import {Tag} from "../../Logic/Tags/Tag"; | ||||
| import BaseUIElement from "../BaseUIElement"; | ||||
| 
 | ||||
| export class ImageUploadFlow extends UIElement { | ||||
|     private readonly _licensePicker: UIElement; | ||||
|     private readonly _licensePicker: BaseUIElement; | ||||
|     private readonly _tags: UIEventSource<any>; | ||||
|     private readonly _selectedLicence: UIEventSource<string>; | ||||
|     private readonly _isUploading: UIEventSource<number> = new UIEventSource<number>(0) | ||||
|  | @ -35,10 +36,8 @@ export class ImageUploadFlow extends UIElement { | |||
|                 {value: "CC-BY-SA 4.0", shown: Translations.t.image.ccbs}, | ||||
|                 {value: "CC-BY 4.0", shown: Translations.t.image.ccb} | ||||
|             ], | ||||
|             State.state.osmConnection.GetPreference("pictures-license"), | ||||
|             "","", | ||||
|             "flex flex-col sm:flex-row" | ||||
|         ); | ||||
|             State.state.osmConnection.GetPreference("pictures-license") | ||||
|         ).SetClass("flex flex-col sm:flex-row"); | ||||
|         licensePicker.SetStyle("float:left"); | ||||
| 
 | ||||
|         const t = Translations.t.image; | ||||
|  | @ -186,8 +185,6 @@ export class ImageUploadFlow extends UIElement { | |||
|     } | ||||
| 
 | ||||
|     InnerUpdate(htmlElement: HTMLElement) { | ||||
|         super.InnerUpdate(htmlElement); | ||||
| 
 | ||||
|         this._licensePicker.Update() | ||||
|         const form = document.getElementById('fileselector-form-' + this.id) as HTMLFormElement | ||||
|         const selector = document.getElementById('fileselector-' + this.id) | ||||
|  |  | |||
|  | @ -35,7 +35,6 @@ export class SlideShow extends UIElement { | |||
|     } | ||||
| 
 | ||||
|     protected InnerUpdate(htmlElement: HTMLElement) { | ||||
|         super.InnerUpdate(htmlElement); | ||||
|         require("slick-carousel") | ||||
|         if(this._embeddedElements.data.length == 0){ | ||||
|             return; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue