mirror of
https://github.com/nasa/openmct.git
synced 2025-02-20 17:33:23 +00:00
[Fixed Position] Add proxy object
Add proxy object to represent the selection of the fixed position view itself, WTD-879.
This commit is contained in:
parent
4be2a3f1cd
commit
97b844563d
@ -1,8 +1,8 @@
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./LayoutDrag'],
|
||||
function (LayoutDrag) {
|
||||
['./LayoutDrag', './LayoutSelection', './FixedProxy'],
|
||||
function (LayoutDrag, LayoutSelection, FixedProxy) {
|
||||
"use strict";
|
||||
|
||||
var DEFAULT_DIMENSIONS = [ 2, 1 ],
|
||||
@ -26,7 +26,8 @@ define(
|
||||
values = {},
|
||||
cellStyles = [],
|
||||
rawPositions = {},
|
||||
positions = {};
|
||||
positions = {},
|
||||
selection;
|
||||
|
||||
// Utility function to copy raw positions from configuration,
|
||||
// without writing directly to configuration (to avoid triggering
|
||||
@ -179,6 +180,14 @@ define(
|
||||
populatePosition(id);
|
||||
}
|
||||
|
||||
// Track current selection state
|
||||
if (Array.isArray($scope.selection)) {
|
||||
selection = new LayoutSelection(
|
||||
$scope.selection,
|
||||
new FixedProxy($scope.configuration)
|
||||
);
|
||||
}
|
||||
|
||||
// Position panes when the model field changes
|
||||
$scope.$watch("model.composition", updateComposition);
|
||||
|
||||
@ -194,14 +203,6 @@ define(
|
||||
// Initialize styles (position etc.) for cells
|
||||
refreshCellStyles();
|
||||
|
||||
if (Array.isArray($scope.selection)) {
|
||||
$scope.selection.push({
|
||||
add: function () {
|
||||
window.alert("Placeholder; not yet implemented");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
/**
|
||||
* Get styles for all background cells, as will populate the
|
||||
|
26
platform/features/layout/src/FixedProxy.js
Normal file
26
platform/features/layout/src/FixedProxy.js
Normal file
@ -0,0 +1,26 @@
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Proxy for configuring a fixed position view via the toolbar.
|
||||
* @constructor
|
||||
* @param configuration the view configuration object
|
||||
*/
|
||||
function FixedProxy(configuration) {
|
||||
return {
|
||||
/**
|
||||
* Add a new visual element to this view.
|
||||
*/
|
||||
add: function (type) {
|
||||
window.alert("Placeholder. Should add a " + type + ".");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return FixedProxy;
|
||||
}
|
||||
);
|
Loading…
x
Reference in New Issue
Block a user