mobility-toolbox-js 2.0.0-beta.41 → 2.0.0-beta.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"Layer.d.ts","sourceRoot":"","sources":["../../../src/common/layers/Layer.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH;IACE;;;;;;;;;;;;OAYG;IACH;QAT4B,GAAG;QACH,IAAI;QACF,UAAU;QACN,QAAQ;QACb,OAAO;QACP,QAAQ;QACT,YAAY;QACZ,UAAU;OA+BrC;IAvBC,iBAAuE;IAEvE,WAA0B;IAE1B,iCAAoC;IAEpC,8BAAgC;IAmBlC;;;;OAIG;IACH,qCA0HC;IAED;;;;OAIG;IACH,4BAUC;IARC,cAAc;IACd,SAAc;IAShB;;OAEG;IAEH,sBAGC;IAED;;;;;;;OAOG;IAEH,qDAJW,MAAM,GACL,QAAQ,WAAW,CAAC,CAiB/B;IAED;;OAEG;IACH,cAEC;CACF"}
1
+ {"version":3,"file":"Layer.d.ts","sourceRoot":"","sources":["../../../src/common/layers/Layer.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH;IACE;;;;;;;;;;;;OAYG;IACH;QAT4B,GAAG;QACH,IAAI;QACF,UAAU;QACN,QAAQ;QACb,OAAO;QACP,QAAQ;QACT,YAAY;QACZ,UAAU;OA+BrC;IAvBC,iBAAuE;IAEvE,WAA0B;IAE1B,iCAAoC;IAEpC,8BAAgC;IAmBlC;;;;OAIG;IACH,qCAyIC;IAED;;;;OAIG;IACH,4BAUC;IARC,cAAc;IACd,SAAc;IAShB;;OAEG;IAEH,sBAGC;IAED;;;;;;;OAOG;IAEH,qDAJW,MAAM,GACL,QAAQ,WAAW,CAAC,CAiB/B;IAED;;OAEG;IACH,cAEC;CACF"}
@@ -103,13 +103,17 @@ export default class Layer extends BaseObject {
103
103
  }
104
104
  this.set('visible', newVisible);
105
105
  if (this.visible) {
106
- if (this.parent && !this.parent.visible) {
106
+ // We make the parent visible
107
+ if (this.parent) {
107
108
  this.parent.visible = true;
108
109
  }
109
- if (this.children && this.children.find((child) => child.group)) {
110
- const child = this.children.find((childd) => !!childd.group);
111
- // Make visible only radioGroup layers
112
- child.visible = true;
110
+ // If children doesn't contain any visible layers, we display all children.
111
+ if (this.children &&
112
+ !this.children.some((child) => child.visible)) {
113
+ this.children.forEach((child) => {
114
+ // eslint-disable-next-line no-param-reassign
115
+ child.visible = true;
116
+ });
113
117
  }
114
118
  // Warn the same group that a new layer is visible
115
119
  if (this.parent && this.group) {
@@ -125,6 +129,14 @@ export default class Layer extends BaseObject {
125
129
  }
126
130
  }
127
131
  else if (!this.visible) {
132
+ // We hide all the children
133
+ if (this.children) {
134
+ this.children.forEach((child) => {
135
+ // eslint-disable-next-line no-param-reassign
136
+ child.visible = false;
137
+ });
138
+ }
139
+ // If the parent has no more visible child we also hide it.
128
140
  if (this.parent &&
129
141
  this.parent.visible &&
130
142
  !this.parent.children.find((child) => child.visible)) {
package/mbt.js CHANGED
@@ -47845,12 +47845,13 @@ uniform ${i3} ${o3} u_${a3};
47845
47845
  }
47846
47846
  this.set("visible", newVisible);
47847
47847
  if (this.visible) {
47848
- if (this.parent && !this.parent.visible) {
47848
+ if (this.parent) {
47849
47849
  this.parent.visible = true;
47850
47850
  }
47851
- if (this.children && this.children.find((child) => child.group)) {
47852
- const child = this.children.find((childd) => !!childd.group);
47853
- child.visible = true;
47851
+ if (this.children && !this.children.some((child) => child.visible)) {
47852
+ this.children.forEach((child) => {
47853
+ child.visible = true;
47854
+ });
47854
47855
  }
47855
47856
  if (this.parent && this.group) {
47856
47857
  let higherParent = this.parent;
@@ -47863,6 +47864,11 @@ uniform ${i3} ${o3} u_${a3};
47863
47864
  });
47864
47865
  }
47865
47866
  } else if (!this.visible) {
47867
+ if (this.children) {
47868
+ this.children.forEach((child) => {
47869
+ child.visible = false;
47870
+ });
47871
+ }
47866
47872
  if (this.parent && this.parent.visible && !this.parent.children.find((child) => child.visible)) {
47867
47873
  this.parent.visible = false;
47868
47874
  }