mirror of
https://github.com/nasa/openmct.git
synced 2025-06-15 21:58:13 +00:00
[Fixed Position] Add button to show/hide telemetry name
Add button to show/hide name of telemetry elements in fixed position view, WTD-881.
This commit is contained in:
@ -120,6 +120,18 @@
|
|||||||
"name": "Text",
|
"name": "Text",
|
||||||
"required": true
|
"required": true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"method": "showTitle",
|
||||||
|
"glyph": "+",
|
||||||
|
"control": "button",
|
||||||
|
"description": "Show telemetry element title."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"method": "hideTitle",
|
||||||
|
"glyph": "X",
|
||||||
|
"control": "button",
|
||||||
|
"description": "Hide telemetry element title."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<div ng-style="{ background: ngModel.fill(), border: '1px solid ' + ngModel.stroke(), color: ngModel.color() }"
|
<div ng-style="{ background: ngModel.fill(), border: '1px solid ' + ngModel.stroke(), color: ngModel.color() }"
|
||||||
style="width: 100%; height: 100%;">
|
style="width: 100%; height: 100%;">
|
||||||
<div style="position: absolute; left: 0px; top: 0px; bottom: 0px; width: 50%; overflow: hidden;">
|
<div style="position: absolute; left: 0px; top: 0px; bottom: 0px; width: 50%; overflow: hidden;"
|
||||||
|
ng-show="ngModel.element.titled">
|
||||||
{{ngModel.name}}
|
{{ngModel.name}}
|
||||||
</div>
|
</div>
|
||||||
<div style="position: absolute; right: 0px; top: 0px; bottom: 0px; width: 50%; overflow: hidden;">
|
<div style="position: absolute; right: 0px; top: 0px; bottom: 0px; width: 50%; overflow: hidden;">
|
||||||
|
@ -195,6 +195,7 @@ define(
|
|||||||
id: id,
|
id: id,
|
||||||
stroke: "transparent",
|
stroke: "transparent",
|
||||||
color: "#717171",
|
color: "#717171",
|
||||||
|
titled: true,
|
||||||
width: DEFAULT_DIMENSIONS[0],
|
width: DEFAULT_DIMENSIONS[0],
|
||||||
height: DEFAULT_DIMENSIONS[1]
|
height: DEFAULT_DIMENSIONS[1]
|
||||||
});
|
});
|
||||||
|
@ -5,6 +5,9 @@ define(
|
|||||||
function (TextProxy, AccessorMutator) {
|
function (TextProxy, AccessorMutator) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
// Method names to expose from this proxy
|
||||||
|
var HIDE = 'hideTitle', SHOW = 'showTitle';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Selection proxy for telemetry elements in a fixed position view.
|
* Selection proxy for telemetry elements in a fixed position view.
|
||||||
*
|
*
|
||||||
@ -20,9 +23,27 @@ define(
|
|||||||
function TelemetryProxy(element, index, elements) {
|
function TelemetryProxy(element, index, elements) {
|
||||||
var proxy = new TextProxy(element, index, elements);
|
var proxy = new TextProxy(element, index, elements);
|
||||||
|
|
||||||
|
// Toggle the visibility of the title
|
||||||
|
function toggle() {
|
||||||
|
// Toggle the state
|
||||||
|
element.titled = !element.titled;
|
||||||
|
|
||||||
|
// Change which method is exposed, to influence
|
||||||
|
// which button is shown in the toolbar
|
||||||
|
delete proxy[SHOW];
|
||||||
|
delete proxy[HIDE];
|
||||||
|
proxy[element.titled ? HIDE : SHOW] = toggle;
|
||||||
|
}
|
||||||
|
|
||||||
// Expose the domain object identifier
|
// Expose the domain object identifier
|
||||||
proxy.id = element.id;
|
proxy.id = element.id;
|
||||||
|
|
||||||
|
// Expose initial toggle
|
||||||
|
proxy[element.titled ? HIDE : SHOW] = toggle;
|
||||||
|
|
||||||
|
// Don't expose text configuration
|
||||||
|
delete proxy.text;
|
||||||
|
|
||||||
return proxy;
|
return proxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user