fixed problem with personalized legend in student's pictos, (issue #650)

parent b436ebc6
...@@ -86,7 +86,9 @@ module.exports = { ...@@ -86,7 +86,9 @@ module.exports = {
status: 'invisible', status: 'invisible',
highlight: false, highlight: false,
color: null, color: null,
expression: null expression: null,
legend: null,
legend_size: 'small'
}; };
if (typeof attributes === 'object') { if (typeof attributes === 'object') {
...@@ -117,6 +119,15 @@ module.exports = { ...@@ -117,6 +119,15 @@ module.exports = {
if (!((/^(invisible|enabled|disabled)$/).test(validAttributes.status))) { if (!((/^(invisible|enabled|disabled)$/).test(validAttributes.status))) {
delete validAttributes.status; delete validAttributes.status;
} }
if (typeof validAttributes.expression !== 'string') {
delete validAttributes.expression;
}
if (typeof validAttributes.legend !== 'boolean') {
delete validAttributes.legend;
}
if (!((/^(small|large)$/).test(validAttributes.legend_size))) {
delete validAttributes.legend_size;
}
if (typeof validAttributes.highlight !== 'boolean') { if (typeof validAttributes.highlight !== 'boolean') {
delete validAttributes.highlight; delete validAttributes.highlight;
} }
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
--> -->
<li class="list-group-item"> <li class="list-group-item">
<div class="checkbox"> <div class="checkbox">
<label><input data-toggle="toggle" type="checkbox" ng-model="studentPicto.attributes.legend" ng-change="update_properties()" translate>legend</label> <input data-toggle="toggle" type="checkbox" ng-model="studentPicto.attributes.legend" ng-change="update_properties()"><label translate>legend</label>
</div> </div>
</ul> </ul>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment