More work on responsive design for small screens

This commit is contained in:
Davide Passoni
2024-07-02 17:36:53 +02:00
parent 00e2da2aab
commit 96b3e2f115
16 changed files with 225 additions and 155 deletions

View File

@@ -377,7 +377,6 @@ export abstract class Unit extends CustomMarker {
/* Leaflet events listeners */
this.on("click", (e) => this.#onClick(e));
this.on("dblclick", (e) => this.#onDoubleClick(e));
this.on("contextmenu", (e) => this.#onContextMenu(e));
this.on("mouseover", () => {
if (this.belongsToCommandedCoalition()) {
this.setHighlighted(true);
@@ -1558,24 +1557,6 @@ export abstract class Unit extends CustomMarker {
});
}
#onContextMenu(e: any) {
var contextActionSet = new ContextActionSet();
var units = getApp().getUnitsManager().getSelectedUnits();
if (!units.includes(this)) units.push(this);
units.forEach((unit: Unit) => {
unit.appendContextActions(contextActionSet);
});
if (Object.keys(contextActionSet.getContextActions()).length > 0) {
getApp()
.getMap()
.showUnitContextMenu(e.originalEvent.x, e.originalEvent.y, e.latlng);
//getApp().getMap().getUnitContextMenu().setContextActions(contextActionSet);
}
}
#updateMarker() {
this.updateVisibility();