New Condition Widget, WIP

- Refine base styling;
- Fix so that edited properties are reactive;
This commit is contained in:
charlesh88 2020-03-25 19:47:21 -07:00
parent 28a603def8
commit 0cae61444d
2 changed files with 21 additions and 4 deletions

View File

@ -1,9 +1,11 @@
<template>
<div class="c-condition-widget">
<a class="c-condition-widget"
:href="internalDomainObject.url"
>
<div class="c-condition-widget__label">
{{ currentDomainObject.label }}
{{ internalDomainObject.label }}
</div>
</div>
</a>
</template>
<script>
@ -11,7 +13,20 @@ export default {
inject: ['openmct', 'domainObject'],
data: function () {
return {
currentDomainObject: this.domainObject
internalDomainObject: this.domainObject
}
},
mounted() {
this.unlisten = this.openmct.objects.observe(this.internalDomainObject, '*', this.updateInternalDomainObject);
},
beforeDestroy() {
if (this.unlisten) {
this.unlisten();
}
},
methods: {
updateInternalDomainObject(domainObject) {
this.internalDomainObject = domainObject;
}
}
}

View File

@ -1,5 +1,7 @@
.c-condition-widget {
$shdwSize: 3px;
@include userSelectNone();
background-color: rgba($colorBodyFg, 0.1); // Give a little presence if the user hasn't defined a fill color
border-radius: $basicCr;
border: 1px solid transparent;
display: inline-block;