Fix up selected vs is_selected.
This commit is contained in:
parent
29509d9633
commit
df79f7c989
|
@ -184,7 +184,7 @@ PlaneObject.prototype.updateIcon = function() {
|
||||||
var col = MarkerColor;
|
var col = MarkerColor;
|
||||||
|
|
||||||
// If this marker is selected we should make it lighter than the rest.
|
// If this marker is selected we should make it lighter than the rest.
|
||||||
if (this.is_selected)
|
if (this.selected)
|
||||||
col = SelectedColor;
|
col = SelectedColor;
|
||||||
|
|
||||||
// If we have not seen a recent update, change color
|
// If we have not seen a recent update, change color
|
||||||
|
@ -196,7 +196,7 @@ PlaneObject.prototype.updateIcon = function() {
|
||||||
if (this.squawk in SpecialSquawks)
|
if (this.squawk in SpecialSquawks)
|
||||||
col = SpecialSquawks[this.squawk].markerColor;
|
col = SpecialSquawks[this.squawk].markerColor;
|
||||||
|
|
||||||
var weight = this.is_selected ? 2 : 1;
|
var weight = this.selected ? 2 : 1;
|
||||||
var rotation = (this.track === null ? 0 : this.track);
|
var rotation = (this.track === null ? 0 : this.track);
|
||||||
|
|
||||||
if (col === this.icon.fillColor && weight === this.icon.strokeWeight && rotation === this.icon.rotation)
|
if (col === this.icon.fillColor && weight === this.icon.strokeWeight && rotation === this.icon.rotation)
|
||||||
|
@ -310,7 +310,7 @@ PlaneObject.prototype.updateMarker = function(moved) {
|
||||||
|
|
||||||
// Update our planes tail line,
|
// Update our planes tail line,
|
||||||
PlaneObject.prototype.updateLines = function() {
|
PlaneObject.prototype.updateLines = function() {
|
||||||
if (!this.is_selected)
|
if (!this.selected)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (var i = 0; i < this.track_linesegs.length; ++i) {
|
for (var i = 0; i < this.track_linesegs.length; ++i) {
|
||||||
|
|
|
@ -583,7 +583,7 @@ function selectPlaneByHex(hex) {
|
||||||
//console.log("select: " + hex);
|
//console.log("select: " + hex);
|
||||||
// If SelectedPlane has something in it, clear out the selected
|
// If SelectedPlane has something in it, clear out the selected
|
||||||
if (SelectedPlane != null) {
|
if (SelectedPlane != null) {
|
||||||
Planes[SelectedPlane].is_selected = false;
|
Planes[SelectedPlane].selected = false;
|
||||||
Planes[SelectedPlane].clearLines();
|
Planes[SelectedPlane].clearLines();
|
||||||
Planes[SelectedPlane].updateMarker();
|
Planes[SelectedPlane].updateMarker();
|
||||||
$(Planes[SelectedPlane].tr).removeClass("selected");
|
$(Planes[SelectedPlane].tr).removeClass("selected");
|
||||||
|
@ -597,7 +597,7 @@ function selectPlaneByHex(hex) {
|
||||||
if (hex !== null) {
|
if (hex !== null) {
|
||||||
// Assign the new selected
|
// Assign the new selected
|
||||||
SelectedPlane = hex;
|
SelectedPlane = hex;
|
||||||
Planes[SelectedPlane].is_selected = true;
|
Planes[SelectedPlane].selected = true;
|
||||||
Planes[SelectedPlane].updateLines();
|
Planes[SelectedPlane].updateLines();
|
||||||
Planes[SelectedPlane].updateMarker();
|
Planes[SelectedPlane].updateMarker();
|
||||||
$(Planes[SelectedPlane].tr).addClass("selected");
|
$(Planes[SelectedPlane].tr).addClass("selected");
|
||||||
|
|
Loading…
Reference in a new issue