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
This commit is contained in:
Kasper Nilsson
2018-01-16 14:20:39 -08:00
parent b67407e06d
commit eb17e1ed0d

View File

@@ -319,10 +319,12 @@ limitations under the License.
/** /**
* @param {{ _number: number, project: string }} change The change object. * @param {{ _number: number, project: string }} change The change object.
* @param {string} path The file path. * @param {string} path The file path.
* @param {number=} opt_patchNum
* @return {string} * @return {string}
*/ */
getEditUrlForDiff(change, path) { getEditUrlForDiff(change, path, opt_patchNum) {
return this.getEditUrlForDiffById(change._number, change.project, path); return this.getEditUrlForDiffById(change._number, change.project, path,
opt_patchNum);
}, },
/** /**
@@ -331,13 +333,13 @@ limitations under the License.
* @param {string} path The file path. * @param {string} path The file path.
* @return {string} * @return {string}
*/ */
getEditUrlForDiffById(changeNum, project, path) { getEditUrlForDiffById(changeNum, project, path, opt_patchNum) {
return this._getUrlFor({ return this._getUrlFor({
view: Gerrit.Nav.View.EDIT, view: Gerrit.Nav.View.EDIT,
changeNum, changeNum,
project, project,
path, path,
patchNum: EDIT_PATCHNUM, patchNum: opt_patchNum || EDIT_PATCHNUM,
}); });
}, },