mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 06:08:11 +00:00
[Fixed Position] Allow select/deselect
Allow select/deselect of individual elements in fixed position view, WTD-879.
This commit is contained in:
@ -3,16 +3,18 @@
|
|||||||
mct-resize="controller.setBounds(bounds)">
|
mct-resize="controller.setBounds(bounds)">
|
||||||
|
|
||||||
<!-- Background grid -->
|
<!-- Background grid -->
|
||||||
|
<span ng-click="controller.clearSelection()">
|
||||||
<div ng-repeat="cell in controller.getCellStyles()"
|
<div ng-repeat="cell in controller.getCellStyles()"
|
||||||
style="position: absolute; border: 1px gray solid; background: black;"
|
style="position: absolute; border: 1px gray solid; background: black;"
|
||||||
ng-click="controller.deselect()"
|
|
||||||
ng-style="cell">
|
ng-style="cell">
|
||||||
</div>
|
</div>
|
||||||
|
</span>
|
||||||
|
|
||||||
<!-- Fixed position elements -->
|
<!-- Fixed position elements -->
|
||||||
<mct-include ng-repeat="element in controller.getDecoratedElements()"
|
<mct-include ng-repeat="element in controller.getDecoratedElements()"
|
||||||
style="position: absolute;"
|
style="position: absolute;"
|
||||||
key="element.template"
|
key="element.template"
|
||||||
|
ng-class="{ test: controller.selected(element) }"
|
||||||
ng-style="element.style"
|
ng-style="element.style"
|
||||||
ng-click="controller.select(element)"
|
ng-click="controller.select(element)"
|
||||||
ng-model="element">
|
ng-model="element">
|
||||||
|
@ -20,8 +20,6 @@ define(
|
|||||||
function FixedController($scope, telemetrySubscriber, telemetryFormatter) {
|
function FixedController($scope, telemetrySubscriber, telemetryFormatter) {
|
||||||
var gridSize = DEFAULT_GRID_SIZE,
|
var gridSize = DEFAULT_GRID_SIZE,
|
||||||
gridExtent = DEFAULT_GRID_EXTENT,
|
gridExtent = DEFAULT_GRID_EXTENT,
|
||||||
activeDrag,
|
|
||||||
activeDragId,
|
|
||||||
subscription,
|
subscription,
|
||||||
cellStyles = [],
|
cellStyles = [],
|
||||||
elementProxies = [],
|
elementProxies = [],
|
||||||
@ -213,20 +211,24 @@ define(
|
|||||||
* @returns {boolean} true if selected
|
* @returns {boolean} true if selected
|
||||||
*/
|
*/
|
||||||
selected: function (element) {
|
selected: function (element) {
|
||||||
return selection.selected(element);
|
return selection && selection.selected(element);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Set the active user selection in this view.
|
* Set the active user selection in this view.
|
||||||
* @param element the element to select
|
* @param element the element to select
|
||||||
*/
|
*/
|
||||||
select: function (element) {
|
select: function (element) {
|
||||||
|
if (selection) {
|
||||||
selection.select(element);
|
selection.select(element);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Clear the current user selection.
|
* Clear the current user selection.
|
||||||
*/
|
*/
|
||||||
clearSelection: function () {
|
clearSelection: function () {
|
||||||
|
if (selection) {
|
||||||
selection.deselect();
|
selection.deselect();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Start a drag gesture to move/resize a frame.
|
* Start a drag gesture to move/resize a frame.
|
||||||
|
Reference in New Issue
Block a user