diff --git a/platform/commonUI/general/src/directives/MCTSplitPane.js b/platform/commonUI/general/src/directives/MCTSplitPane.js index 0262d6f0a2..f84c67a0a3 100644 --- a/platform/commonUI/general/src/directives/MCTSplitPane.js +++ b/platform/commonUI/general/src/directives/MCTSplitPane.js @@ -229,14 +229,13 @@ define( anchor: function () { return anchor; }, - position: function (initialValue, newValue) { + position: function (newPosition) { if (arguments.length === 0) { return getSetPosition(); } - if (initialValue !== newValue) { - setUserWidthPreference(newValue); - getSetPosition(newValue); - } + + setUserWidthPreference(newPosition); + return getSetPosition(newPosition); }, startResizing: function () { toggleClass('resizing'); diff --git a/platform/commonUI/general/src/directives/MCTSplitter.js b/platform/commonUI/general/src/directives/MCTSplitter.js index 315a00fad2..f0e4c69840 100644 --- a/platform/commonUI/general/src/directives/MCTSplitter.js +++ b/platform/commonUI/general/src/directives/MCTSplitter.js @@ -57,7 +57,10 @@ define( // Update the position of this splitter newPosition = initialPosition + pixelDelta; - mctSplitPane.position(initialPosition, newPosition); + + if (initialPosition !== newPosition) { + mctSplitPane.position(newPosition); + } }, // Grab the event when the user is done moving // the splitter and pass it on diff --git a/platform/commonUI/general/test/directives/MCTSplitPaneSpec.js b/platform/commonUI/general/test/directives/MCTSplitPaneSpec.js index 2417ccd2b9..51ebc48244 100644 --- a/platform/commonUI/general/test/directives/MCTSplitPaneSpec.js +++ b/platform/commonUI/general/test/directives/MCTSplitPaneSpec.js @@ -164,9 +164,8 @@ define( }); it("allows positions to be set", function () { - var intitialValue = mockChildren[0].offsetWidth; var testValue = mockChildren[0].offsetWidth + 50; - controller.position(intitialValue, testValue); + controller.position(testValue); expect(mockFirstPane.css).toHaveBeenCalledWith( 'width', (testValue) + 'px' diff --git a/platform/commonUI/general/test/directives/MCTSplitterSpec.js b/platform/commonUI/general/test/directives/MCTSplitterSpec.js index c0550d0975..caf0fd468d 100644 --- a/platform/commonUI/general/test/directives/MCTSplitterSpec.js +++ b/platform/commonUI/general/test/directives/MCTSplitterSpec.js @@ -94,7 +94,7 @@ define( it("repositions during drag", function () { mockScope.splitter.move([10, 0]); expect(mockSplitPane.position) - .toHaveBeenCalledWith(testPosition, testPosition + 10); + .toHaveBeenCalledWith(testPosition + 10); }); it("tell's the splitter when it is done resizing", function () {