mirror of
https://github.com/nasa/openmct.git
synced 2025-06-23 01:18:57 +00:00
update changes requested by victor and update corresponding tests
This commit is contained in:
@ -166,13 +166,14 @@ define(
|
|||||||
// Getter-setter for the pixel offset of the splitter,
|
// Getter-setter for the pixel offset of the splitter,
|
||||||
// relative to the current edge.
|
// relative to the current edge.
|
||||||
function getSetPosition(value) {
|
function getSetPosition(value) {
|
||||||
|
var prior = position;
|
||||||
if (typeof value === 'number') {
|
if (typeof value === 'number') {
|
||||||
position = value;
|
position = value;
|
||||||
enforceExtrema();
|
enforceExtrema();
|
||||||
updateElementPositions();
|
updateElementPositions();
|
||||||
|
|
||||||
// Pass change up so this state can be shared
|
// Pass change up so this state can be shared
|
||||||
if (positionParsed.assign) {
|
if (positionParsed.assign && position !== prior) {
|
||||||
positionParsed.assign($scope, position);
|
positionParsed.assign($scope, position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ define(
|
|||||||
|
|
||||||
// Update the position of this splitter
|
// Update the position of this splitter
|
||||||
newPosition = initialPosition + pixelDelta;
|
newPosition = initialPosition + pixelDelta;
|
||||||
mctSplitPane.position(newPosition);
|
mctSplitPane.position(initialPosition, newPosition);
|
||||||
},
|
},
|
||||||
// Grab the event when the user is done moving
|
// Grab the event when the user is done moving
|
||||||
// the splitter and pass it on
|
// the splitter and pass it on
|
||||||
|
@ -94,7 +94,7 @@ define(
|
|||||||
it("repositions during drag", function () {
|
it("repositions during drag", function () {
|
||||||
mockScope.splitter.move([10, 0]);
|
mockScope.splitter.move([10, 0]);
|
||||||
expect(mockSplitPane.position)
|
expect(mockSplitPane.position)
|
||||||
.toHaveBeenCalledWith(testPosition + 10);
|
.toHaveBeenCalledWith(testPosition, testPosition + 10);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("tell's the splitter when it is done resizing", function () {
|
it("tell's the splitter when it is done resizing", function () {
|
||||||
|
Reference in New Issue
Block a user