UI updates and bug fixes
[browser-rts.git] / src / render / land-development.ts
index 935ff74dbdd74868b9dedda76480e209e9467f68..d5cc4e34baa72615a3d5fa1e99506c7ac617ff84 100644 (file)
@@ -2,6 +2,7 @@ import { BuildQueue } from "../repository/build-queue";
 import { CityWithLocation } from "../repository/city";
 import { Building } from '../repository/buildings';
 import _ from "lodash";
+import { topbar } from "./topbar";
 
 function progressBar(current, max): string {
     const percent = Math.ceil((current/max) * 100);
@@ -32,7 +33,7 @@ export function renderLandDevelopment(city: CityWithLocation, buildings: Buildin
                 <td>${city[building.slug]}</td>
                 <td>
                     <form hx-post="/build">
-                        <input type="number" size="6" name="amount" hx-post="/cost/construction" hx-trigger="change" hx-target="#${building.slug}-cost">
+                        <input type="number" size="6" name="amount" hx-post="/cost/construction" hx-trigger="keyup" hx-target="#${building.slug}-cost">
                         <input type="hidden" name="building_type" value="${building.slug}">
                         <button type="submit">Build</button>
                     </form>
@@ -73,6 +74,5 @@ export function renderLandDevelopment(city: CityWithLocation, buildings: Buildin
     </table>
     </div>
     `;
-
-    return html + queues;
+    return html + queues + topbar(city);
 }
\ No newline at end of file