mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 06:08:11 +00:00
[Fixed Position] Change default behavior for old elements
For elements created before this change where useGrid is not defined, default it to true to ensure consistent display size Inline constant definitions in unit tests if they are only used once
This commit is contained in:
@ -69,7 +69,7 @@ define(
|
||||
* The current grid size of the layout.
|
||||
* @memberof platform/features/layout.ElementProxy#
|
||||
*/
|
||||
this.gridSize = gridSize;
|
||||
this.gridSize = gridSize || [1,1]; //Ensure a reasonable default
|
||||
|
||||
this.resizeHandles = [new ResizeHandle(
|
||||
this.element,
|
||||
@ -182,6 +182,10 @@ define(
|
||||
*/
|
||||
ElementProxy.prototype.getGridSize = function () {
|
||||
var gridSize;
|
||||
// Default to using the grid if useGrid was not defined
|
||||
if (typeof this.element.useGrid === 'undefined') {
|
||||
this.element.useGrid = true;
|
||||
}
|
||||
if (this.element.useGrid) {
|
||||
gridSize = this.gridSize;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user