mirror of
https://github.com/nasa/openmct.git
synced 2025-06-22 00:57:11 +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:
@ -1,8 +1,8 @@
|
|||||||
/*global define*/
|
/*global define*/
|
||||||
|
|
||||||
define(
|
define(
|
||||||
['./LayoutDrag'],
|
['./LayoutDrag', './LayoutSelection', './FixedProxy'],
|
||||||
function (LayoutDrag) {
|
function (LayoutDrag, LayoutSelection, FixedProxy) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var DEFAULT_DIMENSIONS = [ 2, 1 ],
|
var DEFAULT_DIMENSIONS = [ 2, 1 ],
|
||||||
@ -26,7 +26,8 @@ define(
|
|||||||
values = {},
|
values = {},
|
||||||
cellStyles = [],
|
cellStyles = [],
|
||||||
rawPositions = {},
|
rawPositions = {},
|
||||||
positions = {};
|
positions = {},
|
||||||
|
selection;
|
||||||
|
|
||||||
// Utility function to copy raw positions from configuration,
|
// Utility function to copy raw positions from configuration,
|
||||||
// without writing directly to configuration (to avoid triggering
|
// without writing directly to configuration (to avoid triggering
|
||||||
@ -179,6 +180,14 @@ define(
|
|||||||
populatePosition(id);
|
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
|
// Position panes when the model field changes
|
||||||
$scope.$watch("model.composition", updateComposition);
|
$scope.$watch("model.composition", updateComposition);
|
||||||
|
|
||||||
@ -194,14 +203,6 @@ define(
|
|||||||
// Initialize styles (position etc.) for cells
|
// Initialize styles (position etc.) for cells
|
||||||
refreshCellStyles();
|
refreshCellStyles();
|
||||||
|
|
||||||
if (Array.isArray($scope.selection)) {
|
|
||||||
$scope.selection.push({
|
|
||||||
add: function () {
|
|
||||||
window.alert("Placeholder; not yet implemented");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
/**
|
/**
|
||||||
* Get styles for all background cells, as will populate the
|
* 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;
|
||||||
|
}
|
||||||
|
);
|
Reference in New Issue
Block a user