mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 23:28:14 +00:00
move newPosition check from mctSplitPane to splitter
This commit is contained in:
@ -229,14 +229,13 @@ define(
|
|||||||
anchor: function () {
|
anchor: function () {
|
||||||
return anchor;
|
return anchor;
|
||||||
},
|
},
|
||||||
position: function (initialValue, newValue) {
|
position: function (newPosition) {
|
||||||
if (arguments.length === 0) {
|
if (arguments.length === 0) {
|
||||||
return getSetPosition();
|
return getSetPosition();
|
||||||
}
|
}
|
||||||
if (initialValue !== newValue) {
|
|
||||||
setUserWidthPreference(newValue);
|
setUserWidthPreference(newPosition);
|
||||||
getSetPosition(newValue);
|
return getSetPosition(newPosition);
|
||||||
}
|
|
||||||
},
|
},
|
||||||
startResizing: function () {
|
startResizing: function () {
|
||||||
toggleClass('resizing');
|
toggleClass('resizing');
|
||||||
|
@ -57,7 +57,10 @@ define(
|
|||||||
|
|
||||||
// Update the position of this splitter
|
// Update the position of this splitter
|
||||||
newPosition = initialPosition + pixelDelta;
|
newPosition = initialPosition + pixelDelta;
|
||||||
mctSplitPane.position(initialPosition, newPosition);
|
|
||||||
|
if (initialPosition !== newPosition) {
|
||||||
|
mctSplitPane.position(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
|
||||||
|
@ -164,9 +164,8 @@ define(
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("allows positions to be set", function () {
|
it("allows positions to be set", function () {
|
||||||
var intitialValue = mockChildren[0].offsetWidth;
|
|
||||||
var testValue = mockChildren[0].offsetWidth + 50;
|
var testValue = mockChildren[0].offsetWidth + 50;
|
||||||
controller.position(intitialValue, testValue);
|
controller.position(testValue);
|
||||||
expect(mockFirstPane.css).toHaveBeenCalledWith(
|
expect(mockFirstPane.css).toHaveBeenCalledWith(
|
||||||
'width',
|
'width',
|
||||||
(testValue) + 'px'
|
(testValue) + 'px'
|
||||||
|
@ -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, testPosition + 10);
|
.toHaveBeenCalledWith(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