Merge "Merge branch 'stable-2.15'"
diff --git a/src/main/resources/static/find-owners.js b/src/main/resources/static/find-owners.js
index 24a8554..e3338b7 100644
--- a/src/main/resources/static/find-owners.js
+++ b/src/main/resources/static/find-owners.js
@@ -69,7 +69,8 @@
const HTML_SELECT_REVIEWERS =
'<b>Check the box before owner names to select reviewers, ' +
'then click the "Apply" button.' +
- '</b><br><small>Each file needs at least one owner code review vote. ' +
+ '</b><br><small>If owner-approval requirement is enabled, ' +
+ 'each file needs at least one Code-Review +1 vote from an owner. ' +
'Owners listed after a file are ordered by their importance. ' +
'(Or declare "<b><span style="font-size:80%;">' +
'Exempt-From-Owner-Approval:</span></b> ' +
@@ -467,19 +468,23 @@
pageDiv.className = LARGE_PAGE_STYLE;
// Calculate required height, limited to 85% of window height,
// and required width, limited to 75% of window width.
+ var maxHeight = Math.round(window.innerHeight * 0.85);
+ var maxWidth = Math.round(window.innerWidth * 0.75);
pageDiv.style.top = '5%';
pageDiv.style.height = 'auto';
pageDiv.style.left = '10%';
pageDiv.style.width = 'auto';
var rect = pageDiv.getBoundingClientRect();
- var h = Math.round(Math.min(rect.height - 2 * PADDING,
- window.innerHeight * 0.85));
- pageDiv.style.height = h + 'px';
- pageDiv.style.top = Math.round((window.innerHeight - h) / 2) + 'px';
- var w = Math.round(Math.min(rect.width - 2 * PADDING,
- window.innerWidth * 0.75));
- pageDiv.style.width = w + 'px';
- pageDiv.style.left = Math.round((window.innerWidth - w) / 2) + 'px';
+ if (rect.width > maxWidth) {
+ pageDiv.style.width = maxWidth + 'px';
+ rect = pageDiv.getBoundingClientRect();
+ }
+ pageDiv.style.left = Math.round((window.innerWidth - rect.width) / 2) + 'px';
+ if (rect.height > maxHeight) {
+ pageDiv.style.height = maxHeight + 'px';
+ rect = pageDiv.getBoundingClientRect();
+ }
+ pageDiv.style.top = Math.round((window.innerHeight - rect.height) / 2) + 'px';
pageDiv.style.visibility = 'visible';
}
}
@@ -511,12 +516,14 @@
// Hide previous 'Find Owners' button under 'MORE'.
changeActions.setActionHidden('revision', 'find-owners~find-owners', true);
if (!!actionKey) {
- changeActions.setActionHidden('revision', actionKey, false);
- } else {
- actionKey = changeActions.add('revision', 'Find Owners');
- changeActions.addTapListener(actionKey,
- () => popupFindOwnersPage(null, change, revision, false));
+ changeActions.removeTapListener(actionKey);
+ changeActions.remove(actionKey);
}
+ actionKey = changeActions.add('revision', '[Find Owners]');
+ changeActions.setIcon(actionKey, 'robot');
+ changeActions.setTitle(actionKey, 'Find owners of changed files');
+ changeActions.addTapListener(actionKey,
+ () => popupFindOwnersPage(null, change, revision, false));
}
function onClick(e) {
if (pageDiv.style.visibility != 'hidden' && !useContextPopup) {