Upgrade navigation for edits on other patch sets
Upgraded function is not currently used, but will be used in a follow-up
change.
Bug: Issue 4437
Change-Id: I443a30e3718b2793542574fa9995fc622f8388f6
diff --git a/polygerrit-ui/app/elements/core/gr-navigation/gr-navigation.html b/polygerrit-ui/app/elements/core/gr-navigation/gr-navigation.html
index 7b17f22..006b9d9 100644
--- a/polygerrit-ui/app/elements/core/gr-navigation/gr-navigation.html
+++ b/polygerrit-ui/app/elements/core/gr-navigation/gr-navigation.html
@@ -319,10 +319,12 @@
/**
* @param {{ _number: number, project: string }} change The change object.
* @param {string} path The file path.
+ * @param {number=} opt_patchNum
* @return {string}
*/
- getEditUrlForDiff(change, path) {
- return this.getEditUrlForDiffById(change._number, change.project, path);
+ getEditUrlForDiff(change, path, opt_patchNum) {
+ return this.getEditUrlForDiffById(change._number, change.project, path,
+ opt_patchNum);
},
/**
@@ -331,13 +333,13 @@
* @param {string} path The file path.
* @return {string}
*/
- getEditUrlForDiffById(changeNum, project, path) {
+ getEditUrlForDiffById(changeNum, project, path, opt_patchNum) {
return this._getUrlFor({
view: Gerrit.Nav.View.EDIT,
changeNum,
project,
path,
- patchNum: EDIT_PATCHNUM,
+ patchNum: opt_patchNum || EDIT_PATCHNUM,
});
},