Merge "New review UI: Fix display of large avatar image in user popup panel" into stable-2.9
This commit is contained in:
@@ -80,27 +80,33 @@ public class AvatarImage extends Image implements LoadHandler {
|
|||||||
setHeight(info.height() > 0 ? info.height() + "px" : "");
|
setHeight(info.height() > 0 ? info.height() + "px" : "");
|
||||||
setUrl(info.url());
|
setUrl(info.url());
|
||||||
popup(account, addPopup);
|
popup(account, addPopup);
|
||||||
|
} else if (account.email() != null) {
|
||||||
|
loadAvatar(account, size, addPopup);
|
||||||
}
|
}
|
||||||
} else if (account.email() != null) {
|
} else if (account.email() != null) {
|
||||||
// TODO Kill /accounts/*/avatar URL.
|
loadAvatar(account, size, addPopup);
|
||||||
String u = account.email();
|
|
||||||
if (Gerrit.isSignedIn()
|
|
||||||
&& u.equals(Gerrit.getUserAccount().getPreferredEmail())) {
|
|
||||||
u = "self";
|
|
||||||
}
|
|
||||||
RestApi api = new RestApi("/accounts/").id(u).view("avatar");
|
|
||||||
if (size > 0) {
|
|
||||||
api.addParameter("s", size);
|
|
||||||
setSize("", size + "px");
|
|
||||||
}
|
|
||||||
setVisible(false);
|
|
||||||
setUrl(api.url());
|
|
||||||
popup(account, addPopup);
|
|
||||||
} else {
|
} else {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void loadAvatar(AccountInfo account, int size, boolean addPopup) {
|
||||||
|
// TODO Kill /accounts/*/avatar URL.
|
||||||
|
String u = account.email();
|
||||||
|
if (Gerrit.isSignedIn()
|
||||||
|
&& u.equals(Gerrit.getUserAccount().getPreferredEmail())) {
|
||||||
|
u = "self";
|
||||||
|
}
|
||||||
|
RestApi api = new RestApi("/accounts/").id(u).view("avatar");
|
||||||
|
if (size > 0) {
|
||||||
|
api.addParameter("s", size);
|
||||||
|
setSize("", size + "px");
|
||||||
|
}
|
||||||
|
setVisible(false);
|
||||||
|
setUrl(api.url());
|
||||||
|
popup(account, addPopup);
|
||||||
|
}
|
||||||
|
|
||||||
private void popup(AccountInfo account, boolean addPopup) {
|
private void popup(AccountInfo account, boolean addPopup) {
|
||||||
if (addPopup) {
|
if (addPopup) {
|
||||||
PopupHandler popupHandler = new PopupHandler(account, this);
|
PopupHandler popupHandler = new PopupHandler(account, this);
|
||||||
|
|||||||
Reference in New Issue
Block a user