mirror of
https://github.com/nasa/openmct.git
synced 2025-05-06 02:28:21 +00:00
[Inspector] Simplify splitter communication
This commit is contained in:
parent
f7839b758d
commit
1c4a4e475b
@ -178,14 +178,10 @@ define(
|
|||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dynamically apply a CSS class to elements when the user is actively resizing
|
// Dynamically apply a CSS class to elements when the user
|
||||||
function splitterState(state) {
|
// is actively resizing
|
||||||
var
|
function toggleClass(classToToggle) {
|
||||||
children = $element.children(),
|
$element.children().toggleClass(classToToggle);
|
||||||
i;
|
|
||||||
for (i = 0; i < children.length; i++) {
|
|
||||||
children.eq(i).toggleClass('resizing');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure anchor parameter is something we know
|
// Make sure anchor parameter is something we know
|
||||||
@ -218,7 +214,7 @@ define(
|
|||||||
// Interface exposed by controller, for mct-splitter to user
|
// Interface exposed by controller, for mct-splitter to user
|
||||||
return {
|
return {
|
||||||
position: getSetPosition,
|
position: getSetPosition,
|
||||||
action: splitterState,
|
toggleClass: toggleClass,
|
||||||
anchor: function () {
|
anchor: function () {
|
||||||
return anchor;
|
return anchor;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ define(
|
|||||||
startMove: function () {
|
startMove: function () {
|
||||||
var splitter = element[0];
|
var splitter = element[0];
|
||||||
initialPosition = mctSplitPane.position();
|
initialPosition = mctSplitPane.position();
|
||||||
mctSplitPane.action('startMove');
|
mctSplitPane.toggleClass('resizing');
|
||||||
},
|
},
|
||||||
// Handle user changes to splitter position
|
// Handle user changes to splitter position
|
||||||
move: function (delta) {
|
move: function (delta) {
|
||||||
@ -66,9 +66,10 @@ define(
|
|||||||
// Update the position of this splitter
|
// Update the position of this splitter
|
||||||
mctSplitPane.position(initialPosition + pixelDelta);
|
mctSplitPane.position(initialPosition + pixelDelta);
|
||||||
},
|
},
|
||||||
// Grab the event when the user is done moving the splitter and pass it on
|
// Grab the event when the user is done moving
|
||||||
|
// the splitter and pass it on
|
||||||
endMove: function() {
|
endMove: function() {
|
||||||
mctSplitPane.action('endMove');
|
mctSplitPane.toggleClass('resizing');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user