forked from MapComplete/MapComplete
		
	Add hotkeys, document hotkeys, make 'DefaultGUI' runnable via NodeJS, generate hotkey documentation
This commit is contained in:
		
							parent
							
								
									e2419c19cd
								
							
						
					
					
						commit
						43613e4ece
					
				
					 16 changed files with 328 additions and 89 deletions
				
			
		|  | @ -5,6 +5,7 @@ import { UIEventSource } from "../../Logic/UIEventSource" | |||
| import Hash from "../../Logic/Web/Hash" | ||||
| import BaseUIElement from "../BaseUIElement" | ||||
| import Title from "./Title" | ||||
| import Hotkeys from "./Hotkeys" | ||||
| 
 | ||||
| /** | ||||
|  * | ||||
|  | @ -82,12 +83,11 @@ export default class ScrollableFullScreen { | |||
|     } | ||||
| 
 | ||||
|     private static initEmpty(): FixedUiElement { | ||||
|         document.addEventListener("keyup", function (event) { | ||||
|             if (event.code === "Escape") { | ||||
|                 ScrollableFullScreen.collapse() | ||||
|                 event.preventDefault() | ||||
|             } | ||||
|         }) | ||||
|         Hotkeys.RegisterHotkey( | ||||
|             { nomod: "Escape", onUp: true }, | ||||
|             "Close the sidebar", | ||||
|             ScrollableFullScreen.collapse | ||||
|         ) | ||||
| 
 | ||||
|         return new FixedUiElement("") | ||||
|     } | ||||
|  | @ -117,7 +117,7 @@ export default class ScrollableFullScreen { | |||
|         this._fullscreencomponent.AttachTo("fullscreen") | ||||
|         const fs = document.getElementById("fullscreen") | ||||
|         ScrollableFullScreen._currentlyOpen = this | ||||
|         fs.classList.remove("hidden") | ||||
|         fs?.classList?.remove("hidden") | ||||
|     } | ||||
| 
 | ||||
|     private BuildComponent(title: BaseUIElement, content: BaseUIElement): BaseUIElement { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue