aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/components/ui
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/ng2/components/ui')
-rw-r--r--catalog-ui/src/app/ng2/components/ui/dynamic-element/dynamic-element.component.ts8
-rw-r--r--catalog-ui/src/app/ng2/components/ui/form-components/checkbox/checkbox.component.less13
2 files changed, 15 insertions, 6 deletions
diff --git a/catalog-ui/src/app/ng2/components/ui/dynamic-element/dynamic-element.component.ts b/catalog-ui/src/app/ng2/components/ui/dynamic-element/dynamic-element.component.ts
index 76b0b9ec2b..4f283fb3f1 100644
--- a/catalog-ui/src/app/ng2/components/ui/dynamic-element/dynamic-element.component.ts
+++ b/catalog-ui/src/app/ng2/components/ui/dynamic-element/dynamic-element.component.ts
@@ -175,8 +175,12 @@ export class DynamicElementComponent {
tmp.push(new DropdownValue(true,'TRUE'));
tmp.push(new DropdownValue(false,'FALSE'));
this.cmpRef.instance.values = tmp;
- if(!_.isUndefined(this.value)){//contains the real value (and not a string)
- this.value = JSON.parse(this.value);
+ try {
+ if (typeof this.value === 'string') {
+ this.value = JSON.parse(this.value);
+ }
+ } catch(err) {
+ this.value = null;
}
break;
diff --git a/catalog-ui/src/app/ng2/components/ui/form-components/checkbox/checkbox.component.less b/catalog-ui/src/app/ng2/components/ui/form-components/checkbox/checkbox.component.less
index 9df2680b6f..5c061a4b5e 100644
--- a/catalog-ui/src/app/ng2/components/ui/form-components/checkbox/checkbox.component.less
+++ b/catalog-ui/src/app/ng2/components/ui/form-components/checkbox/checkbox.component.less
@@ -38,11 +38,16 @@
width:0;
height:0;
display:none;
- &:checked ~ .checkbox-icon::before{
- .sprite-new;
- .filled-checkbox-icon
+ &:checked {
+ ~ .checkbox-icon::before{
+ .sprite-new;
+ .filled-checkbox-icon
+ }
+ &[disabled] ~ .checkbox-icon::before {
+ opacity: 0.5;
+ }
}
- &[disabled] ~ .checkbox-icon::before {
+ &[disabled]:not(:checked) ~ .checkbox-icon::before {
/* TODO: add disabled styles here */
background-image: none;
background-color: #EFEFEF;