Use #/settings in user popdown panel
Instead of linking to /settings which causes a GWT UI reload, use #/settings allowing the UI to be replaced. This fixes a visible glitch when clicking Settings in debug mode and Buck is kicked off to update the JS code, and even in production installations when the server is far away from the user. Change-Id: I0c57d6d93eaf9f102ad78e362cbbada1785853e4
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
package com.google.gerrit.client;
|
package com.google.gerrit.client;
|
||||||
|
|
||||||
import com.google.gerrit.client.account.AccountInfo;
|
import com.google.gerrit.client.account.AccountInfo;
|
||||||
|
import com.google.gerrit.client.ui.InlineHyperlink;
|
||||||
import com.google.gerrit.common.PageLinks;
|
import com.google.gerrit.common.PageLinks;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
import com.google.gwt.uibinder.client.UiBinder;
|
||||||
@@ -39,7 +40,7 @@ public class UserPopupPanel extends PluginSafePopupPanel {
|
|||||||
@UiField
|
@UiField
|
||||||
Anchor logout;
|
Anchor logout;
|
||||||
@UiField
|
@UiField
|
||||||
Anchor settings;
|
InlineHyperlink settings;
|
||||||
|
|
||||||
public UserPopupPanel(AccountInfo account, boolean canLogOut,
|
public UserPopupPanel(AccountInfo account, boolean canLogOut,
|
||||||
boolean showSettingsLink) {
|
boolean showSettingsLink) {
|
||||||
@@ -64,7 +65,7 @@ public class UserPopupPanel extends PluginSafePopupPanel {
|
|||||||
logout.setVisible(false);
|
logout.setVisible(false);
|
||||||
}
|
}
|
||||||
if (showSettingsLink) {
|
if (showSettingsLink) {
|
||||||
settings.setHref(Gerrit.selfRedirect(PageLinks.SETTINGS));
|
settings.setTargetHistoryToken(PageLinks.SETTINGS);
|
||||||
} else {
|
} else {
|
||||||
settings.setVisible(false);
|
settings.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ limitations under the License.
|
|||||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||||
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
|
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
|
||||||
xmlns:g='urn:import:com.google.gwt.user.client.ui'
|
xmlns:g='urn:import:com.google.gwt.user.client.ui'
|
||||||
xmlns:gerrit='urn:import:com.google.gerrit.client'>
|
xmlns:gerrit='urn:import:com.google.gerrit.client'
|
||||||
|
xmlns:u='urn:import:com.google.gerrit.client.ui'>
|
||||||
<ui:with field='constants' type='com.google.gerrit.client.GerritConstants'/>
|
<ui:with field='constants' type='com.google.gerrit.client.GerritConstants'/>
|
||||||
|
|
||||||
<ui:style>
|
<ui:style>
|
||||||
@@ -51,9 +52,9 @@ limitations under the License.
|
|||||||
<g:Label ui:field='userName' styleName="{style.userName}" />
|
<g:Label ui:field='userName' styleName="{style.userName}" />
|
||||||
<g:Label ui:field='userEmail' styleName="{style.email}" />
|
<g:Label ui:field='userEmail' styleName="{style.email}" />
|
||||||
</td></tr></table>
|
</td></tr></table>
|
||||||
<g:Anchor ui:field='settings'>
|
<u:InlineHyperlink ui:field='settings'>
|
||||||
<ui:text from='{constants.menuSettings}' />
|
<ui:msg>Settings</ui:msg>
|
||||||
</g:Anchor>
|
</u:InlineHyperlink>
|
||||||
<g:Anchor ui:field='logout' styleName="{style.logout}">
|
<g:Anchor ui:field='logout' styleName="{style.logout}">
|
||||||
<ui:text from='{constants.menuSignOut}' />
|
<ui:text from='{constants.menuSignOut}' />
|
||||||
</g:Anchor>
|
</g:Anchor>
|
||||||
|
|||||||
Reference in New Issue
Block a user