Store number of files displayed in _viewState
Previously, if a user viewed more files or expanded all files, navigated to a diff view, and back to the file list, it would not preserve the state that it was left in. Because the Polymer elements are recreated when the change view reloads, the number of files shown property is reset to the default value. This change adds an attribute in _viewState.changeView to store the number of files shown. It preserves the state of the change view when navigating to pages of a different type (ex: diff) and then back to the change view. When a new change view is rendered (with a different change number), the default files shown is reset. Bug: Issue 5877 Change-Id: I36f9bc64b7d64a23a41c195b2e8188daf47d063f
This commit is contained in:
@@ -60,6 +60,7 @@ limitations under the License.
|
||||
reload: function() { return Promise.resolve(); },
|
||||
});
|
||||
element = fixture('basic');
|
||||
element.numFilesShown = 75;
|
||||
saveStub = sandbox.stub(element, '_saveReviewedState',
|
||||
function() { return Promise.resolve(); });
|
||||
});
|
||||
@@ -738,7 +739,7 @@ limitations under the License.
|
||||
arr.push({__path: 'myfile.txt'});
|
||||
});
|
||||
element._files = arr;
|
||||
element._numFilesShown = arr.length;
|
||||
element.numFilesShown = arr.length;
|
||||
assert.isFalse(computeSpy.lastCall.returnValue);
|
||||
done();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user