Skip to content
Snippets Groups Projects
Commit f51b3253 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

restrict opacity form to polygon & adapt default data value to prop type

parent d569c62b
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@
:name="form.color.html_name"
>
</div>
<div>
<div v-if="geomType === 'polygon'">
<label>Opacité &nbsp;<span>(%)</span></label>
<div class="range-container">
<input
......@@ -107,7 +107,7 @@ export default {
html_name: 'couleur',
value: '#000000',
},
opacity: 1,
opacity: '0.5',
}
};
},
......
......@@ -99,10 +99,7 @@
feature_type.colors_style.value.icons[option] :
null
"
:init-opacity="feature_type.colors_style.value ?
feature_type.colors_style.value.opacities[option] :
null
"
:init-opacity="getOpacity(feature_type, option)"
:geom-type="feature_type.customfield_set.geomType"
@set="setColorsStyle"
/>
......@@ -306,6 +303,13 @@ export default {
console.error(err);
this.loading = false;
});
},
getOpacity(feature_type, optionName) {
if (feature_type.colors_style.value && feature_type.colors_style.value.opacities) {
return feature_type.colors_style.value.opacities[optionName];
}
return null;
}
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment