diff --git a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.html b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.html index 664d44e904..22f742de69 100644 --- a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.html +++ b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.html @@ -463,7 +463,8 @@ limitations under the License. revisions="[[_change.revisions]]" project-config="[[_projectConfig]]" selected-index="{{viewState.selectedFileIndex}}" - diff-view-mode="{{viewState.diffMode}}"> + diff-view-mode="{{viewState.diffMode}}" + num-files-shown="{{_numFilesShown}}"> - [[_computeIncrementText(_numFilesShown, _files)]] + [[_computeIncrementText(numFilesShown, _files)]] [[_computeShowAllText(_files)]] diff --git a/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.js b/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.js index cbba46e6a4..d06a6954be 100644 --- a/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.js +++ b/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.js @@ -72,9 +72,9 @@ _userPrefs: Object, _localPrefs: Object, _showInlineDiffs: Boolean, - _numFilesShown: { + numFilesShown: { type: Number, - value: 75, + notify: true, }, _patchChange: { type: Object, @@ -95,7 +95,7 @@ }, _shownFiles: { type: Array, - computed: '_computeFilesShown(_numFilesShown, _files.*)', + computed: '_computeFilesShown(numFilesShown, _files.*)', }, // Caps the number of files that can be shown and have the 'show diffs' / // 'hide diffs' buttons still be functional. @@ -701,7 +701,7 @@ }, _incrementNumFilesShown: function() { - this._numFilesShown += this._fileListIncrement; + this.numFilesShown += this._fileListIncrement; }, _computeFileListButtonHidden: function(numFilesShown, files) { @@ -721,7 +721,7 @@ }, _showAllFiles: function() { - this._numFilesShown = this._files.length; + this.numFilesShown = this._files.length; }, _updateSelected: function(patchRange) { diff --git a/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list_test.html b/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list_test.html index 6197541e4f..c006f68bfd 100644 --- a/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list_test.html +++ b/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list_test.html @@ -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(); }); diff --git a/polygerrit-ui/app/elements/gr-app.js b/polygerrit-ui/app/elements/gr-app.js index af24c5d922..c24e2aa9cb 100644 --- a/polygerrit-ui/app/elements/gr-app.js +++ b/polygerrit-ui/app/elements/gr-app.js @@ -101,6 +101,7 @@ selectedFileIndex: 0, showReplyDialog: false, diffMode: null, + numFilesShown: null, }, changeListView: { query: null,