mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Selected unit measurement now works.
This commit is contained in:
parent
d87139b619
commit
5033cccda0
@ -72,10 +72,14 @@ dl.ol-data-grid dd {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.br-info[data-bearing][data-distance][data-distance-units]::after {
|
||||
.br-info::after {
|
||||
content: attr( data-bearing ) '\00B0 / ' attr( data-distance ) attr( data-distance-units );
|
||||
}
|
||||
|
||||
.br-info[data-message]::after {
|
||||
content: attr( data-message );
|
||||
}
|
||||
|
||||
.coordinates::after {
|
||||
content: attr( data-dd ) "\00b0 " attr( data-mm ) "'" attr( data-ss ) "." attr( data-sss ) '"' attr( data-label );
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
#mouse-info-panel dt {
|
||||
height:20px;
|
||||
width:40%;
|
||||
width:30%;
|
||||
}
|
||||
|
||||
#mouse-info-panel dt::after {
|
||||
@ -44,12 +44,20 @@
|
||||
width:16px;
|
||||
}
|
||||
|
||||
#mouse-info-panel dt#ref-measure-position::after {
|
||||
#mouse-info-panel dt#ref-unit-position::after {
|
||||
background-image: url( "/images/icons/ruler.svg" );
|
||||
background-position: 50% 50%;
|
||||
background-repeat: no-repeat;
|
||||
background-size:16px 16px;
|
||||
content: " ";
|
||||
content: "";
|
||||
}
|
||||
|
||||
#mouse-info-panel dt#ref-measure-position::after {
|
||||
background-image: url( "/images/pin.png" );
|
||||
background-position: 50% 50%;
|
||||
background-repeat: no-repeat;
|
||||
background-size:16px 16px;
|
||||
content: "";
|
||||
}
|
||||
|
||||
|
||||
@ -79,5 +87,5 @@
|
||||
}
|
||||
|
||||
#mouse-info-panel dd {
|
||||
width:60%;
|
||||
width:70%;
|
||||
}
|
||||
@ -155,13 +155,30 @@ export class MouseInfoPanel extends Panel {
|
||||
|
||||
#onUnitsSelection(units: Unit[])
|
||||
{
|
||||
if (units.length == 1)
|
||||
this.getElement().querySelector(`#unit-position`)?.classList.toggle("hide", false);
|
||||
const pos = this.getElement().querySelector(`#unit-position`);
|
||||
|
||||
if ( units.length > 1 ) {
|
||||
pos?.setAttribute( "data-message", "(multiple units)" );
|
||||
} else {
|
||||
pos?.removeAttribute( "data-message" );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#onClearSelection()
|
||||
{
|
||||
this.#measureBox.classList.toggle("hide", true);
|
||||
this.getElement().querySelector(`#unit-position`)?.classList.toggle("hide", true);
|
||||
|
||||
const pos = this.getElement().querySelector(`#unit-position`);
|
||||
|
||||
|
||||
if ( pos instanceof HTMLElement ) {
|
||||
pos?.removeAttribute( "data-message" );
|
||||
|
||||
pos.dataset.bearing = "---";
|
||||
pos.dataset.distance = "---";
|
||||
pos.dataset.distanceUnits = "nm";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,14 +4,16 @@
|
||||
<dl class="ol-data-grid">
|
||||
<dt id="ref-measure-position" data-tooltip="CTRL-click on the map to activate the measuring tool."></dt>
|
||||
<dd id="measure-position" class="br-info" data-bearing="---" data-distance="---" data-distance-units="nm"></dd>
|
||||
<dt id="ref-unit-position" data-tooltip="Bearing/range from selected unit."></dt>
|
||||
<dd id="unit-position" class="br-info" data-bearing="---" data-distance="---" data-distance-units="nm"></dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<dl class="ol-data-grid">
|
||||
<dt id="ref-bullseye-2" data-label="BE" data-coalition="blue"></dt>
|
||||
<dt id="ref-bullseye-2" data-tooltip="Bearing/range from this bullseye." data-label="BE" data-coalition="blue"></dt>
|
||||
<dd id="bullseye-2" class="br-info" data-bearing="---" data-distance="---" data-distance-units="nm"></dd>
|
||||
<dt id="ref-bullseye-1" data-label="BE" data-coalition="red"></dt>
|
||||
<dt id="ref-bullseye-1" data-tooltip="Bearing/range from this bullseye." data-label="BE" data-coalition="red"></dt>
|
||||
<dd id="bullseye-1" class="br-info" data-bearing="---" data-distance="---" data-distance-units="nm"></dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user