Skip to content

Commit

Permalink
Fix autoRange population and all enabled checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley committed Jul 17, 2023
1 parent 4ced213 commit 97b67e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export default {
this.fetchCurrentFrameHistogram()
},
initializeStateFromStyle() {
this.enabledLayers = []
const styleArray = this.currentStyle.bands
this.layers.forEach((layerName) => {
const layerInfo = this.compositeLayerInfo[layerName]
Expand All @@ -112,7 +113,9 @@ export default {
&& currentLayerStyle.min.includes("min:")
&& currentLayerStyle.max.includes("max:")
) {
currentLayerStyle.autoRange = currentLayerStyle.min.replace("min:", '')
currentLayerStyle.autoRange = parseFloat(
currentLayerStyle.min.replace("min:", '')
) * 100
currentLayerStyle.min = undefined
currentLayerStyle.max = undefined
}
Expand Down Expand Up @@ -141,7 +144,7 @@ export default {
});
},
toggleEnableAll() {
if (this.enabledLayers !== this.layers) {
if (!this.layers.every((l) => this.enabledLayers.includes(l))) {
this.enabledLayers = this.layers
} else {
this.enabledLayers = []
Expand Down Expand Up @@ -323,7 +326,7 @@ export default {
<input
type="checkbox"
class="input-80"
:checked="enabledLayers === layers"
:checked="layers.every((l) => enabledLayers.includes(l))"
@input="toggleEnableAll"
>
</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default {
this.$emit('setCurrentFrame', preset.frame)
}
if (preset.style && Object.keys(preset.style.bands).length) {
console.log(preset.style)
this.$emit('updateStyle', preset.mode.id, preset.style)
}
}
Expand Down

0 comments on commit 97b67e9

Please sign in to comment.