mirror of
https://github.com/nasa/openmct.git
synced 2025-01-01 19:06:40 +00:00
[Fixed Position] Fill available area with grid
Fill available space with background grid for fixed position view, WTD-615.
This commit is contained in:
parent
b2bfa2b09b
commit
bd068f31c5
@ -1,7 +1,8 @@
|
||||
|
||||
|
||||
<div style="width: 100%; height: 100%; position: absolute; left: 0px; top: 0px;"
|
||||
ng-controller="FixedController as controller">
|
||||
ng-controller="FixedController as controller"
|
||||
mct-resize="controller.setBounds(bounds)">
|
||||
|
||||
<!-- Background grid -->
|
||||
<div ng-repeat="cell in controller.getCellStyles()"
|
||||
|
@ -49,8 +49,8 @@ define(
|
||||
cellStyles.push({
|
||||
left: x * gridSize[0] + 'px',
|
||||
top: y * gridSize[1] + 'px',
|
||||
width: gridSize[0] - 2 + 'px',
|
||||
height: gridSize[1] - 2 + 'px'
|
||||
width: gridSize[0] - 1 + 'px',
|
||||
height: gridSize[1] - 1 + 'px'
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -120,6 +120,19 @@ define(
|
||||
getCellStyles: function () {
|
||||
return cellStyles;
|
||||
},
|
||||
/**
|
||||
* Set the size of the viewable fixed position area.
|
||||
* @memberof FixedController#
|
||||
* @param bounds the width/height, as reported by mct-resize
|
||||
*/
|
||||
setBounds: function (bounds) {
|
||||
var w = Math.ceil(bounds.width / gridSize[0]),
|
||||
h = Math.ceil(bounds.height / gridSize[1]);
|
||||
if (w !== gridExtent[0] || h !== gridExtent[1]) {
|
||||
gridExtent = [w, h];
|
||||
refreshCellStyles();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Get a style object for a frame with the specified domain
|
||||
* object identifier, suitable for use in an `ng-style`
|
||||
|
Loading…
Reference in New Issue
Block a user