Persist User preference widths for MCTSplitPane
Fix to Issue #1646 Persist MCTSplitPane widths to local storage, thus when user reloads, the Panes maintain dimensions Use persisted widths if available otherwise use default Add tests for localStorage and fix failing tests
This commit is contained in:
@@ -57,7 +57,7 @@ define(
|
||||
testAttrs = {};
|
||||
mockSplitPane = jasmine.createSpyObj(
|
||||
'mctSplitPane',
|
||||
['position', 'toggleClass', 'anchor']
|
||||
['position', 'startResizing', 'endResizing', 'anchor']
|
||||
);
|
||||
|
||||
mctSplitter.link(
|
||||
@@ -86,9 +86,9 @@ define(
|
||||
mockScope.splitter.startMove();
|
||||
});
|
||||
|
||||
it("adds a 'resizing' class", function () {
|
||||
expect(mockSplitPane.toggleClass)
|
||||
.toHaveBeenCalledWith('resizing');
|
||||
it("tell's the splitter when it is resizing", function () {
|
||||
expect(mockSplitPane.startResizing)
|
||||
.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("repositions during drag", function () {
|
||||
@@ -97,11 +97,10 @@ define(
|
||||
.toHaveBeenCalledWith(testPosition + 10);
|
||||
});
|
||||
|
||||
it("removes the 'resizing' class when finished", function () {
|
||||
mockSplitPane.toggleClass.reset();
|
||||
it("tell's the splitter when it is done resizing", function () {
|
||||
mockScope.splitter.move([10,0]);
|
||||
mockScope.splitter.endMove();
|
||||
expect(mockSplitPane.toggleClass)
|
||||
.toHaveBeenCalledWith('resizing');
|
||||
expect(mockSplitPane.endResizing).toHaveBeenCalledWith(testPosition + 10);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user