mirror of
https://github.com/nasa/openmct.git
synced 2025-06-06 01:11:41 +00:00
[Common UI] Get split pane width from elements
WTD-1363.
This commit is contained in:
parent
c79b018c84
commit
a0d5a1a196
@ -22,11 +22,9 @@
|
|||||||
<div content="jquery-wrapper" class="abs holder-all browse-mode">
|
<div content="jquery-wrapper" class="abs holder-all browse-mode">
|
||||||
<mct-include key="'topbar-browse'"></mct-include>
|
<mct-include key="'topbar-browse'"></mct-include>
|
||||||
<div class="holder browse-area s-browse-area abs" ng-controller="BrowseController">
|
<div class="holder browse-area s-browse-area abs" ng-controller="BrowseController">
|
||||||
<mct-split-pane class='split-layout vertical contents abs'
|
<mct-split-pane class='contents abs' anchor='left'>
|
||||||
anchor='left'
|
|
||||||
initial="25%">
|
|
||||||
<div class='split-pane-component treeview pane'
|
<div class='split-pane-component treeview pane'
|
||||||
style="min-width: 150px; max-width: 800px;">
|
style="min-width: 150px; max-width: 800px; width: 25%;">
|
||||||
<mct-representation key="'create-button'" mct-object="navigatedObject">
|
<mct-representation key="'create-button'" mct-object="navigatedObject">
|
||||||
</mct-representation>
|
</mct-representation>
|
||||||
<div class='holder tree-holder abs'>
|
<div class='holder tree-holder abs'>
|
||||||
|
@ -72,8 +72,6 @@ define(
|
|||||||
* Implements `mct-split-pane` directive.
|
* Implements `mct-split-pane` directive.
|
||||||
*
|
*
|
||||||
* This takes the following attributes:
|
* This takes the following attributes:
|
||||||
* * `initial`: Initial positioning to use, as a plain string.
|
|
||||||
* For example, "30%"
|
|
||||||
* * `position`: Two-way bound scope variable which will contain
|
* * `position`: Two-way bound scope variable which will contain
|
||||||
* the pixel position of the splitter, offset from the appropriate
|
* the pixel position of the splitter, offset from the appropriate
|
||||||
* edge.
|
* edge.
|
||||||
@ -106,7 +104,7 @@ define(
|
|||||||
function controller($scope, $element, $attrs) {
|
function controller($scope, $element, $attrs) {
|
||||||
var anchorKey = $attrs.anchor || DEFAULT_ANCHOR,
|
var anchorKey = $attrs.anchor || DEFAULT_ANCHOR,
|
||||||
anchor,
|
anchor,
|
||||||
styleValue = $attrs.initial,
|
styleValue,
|
||||||
positionParsed = $parse($attrs.position),
|
positionParsed = $parse($attrs.position),
|
||||||
position; // Start undefined, until explicitly set
|
position; // Start undefined, until explicitly set
|
||||||
|
|
||||||
@ -133,11 +131,13 @@ define(
|
|||||||
firstSize;
|
firstSize;
|
||||||
|
|
||||||
first.css(anchor.edge, "0px");
|
first.css(anchor.edge, "0px");
|
||||||
first.css(anchor.dimension, styleValue);
|
if (styleValue !== undefined) {
|
||||||
|
first.css(anchor.dimension, styleValue);
|
||||||
|
}
|
||||||
|
|
||||||
// Get actual size (to obey min-width etc.)
|
// Get actual size (to obey min-width etc.)
|
||||||
firstSize = getSize(first[0]);
|
firstSize = getSize(first[0]);
|
||||||
|
first.css(anchor.dimension, firstSize);
|
||||||
splitter.css(anchor.edge, firstSize);
|
splitter.css(anchor.edge, firstSize);
|
||||||
|
|
||||||
last.css(anchor.edge, calcSum(firstSize, splitterSize));
|
last.css(anchor.edge, calcSum(firstSize, splitterSize));
|
||||||
@ -191,6 +191,9 @@ define(
|
|||||||
|
|
||||||
$scope.$watch($attrs.position, getSetPosition);
|
$scope.$watch($attrs.position, getSetPosition);
|
||||||
|
|
||||||
|
$element.addClass("split-layout");
|
||||||
|
$element.addClass(anchor.orientation);
|
||||||
|
|
||||||
// Initialize positions
|
// Initialize positions
|
||||||
updateElementPositions();
|
updateElementPositions();
|
||||||
|
|
||||||
@ -207,7 +210,7 @@ define(
|
|||||||
// Restrict to attributes
|
// Restrict to attributes
|
||||||
restrict: "E",
|
restrict: "E",
|
||||||
// Expose its controller
|
// Expose its controller
|
||||||
controller: controller
|
controller: ['$scope', '$element', '$attrs', controller]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user