mirror of
https://github.com/nasa/openmct.git
synced 2025-01-21 20:08:06 +00:00
New Condition Widget, WIP
- Refine base styling; - Fix so that edited properties are reactive;
This commit is contained in:
parent
28a603def8
commit
0cae61444d
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user