Fix RpcStatus to display "Working..." when header is hidden
Simplify the DOM structure and place "Working..." at the top level of the document, positioned using fixed positioning. Now it is always visible when saving a draft comment is slow. Change-Id: I106dece4265b51b4e38585c03026b158d5876761
This commit is contained in:
@@ -560,7 +560,7 @@ public class Gerrit implements EntryPoint {
|
||||
};
|
||||
gBody.add(body);
|
||||
|
||||
RpcStatus.INSTANCE = new RpcStatus(topMenu);
|
||||
RpcStatus.INSTANCE = new RpcStatus();
|
||||
JsonUtil.addRpcStartHandler(RpcStatus.INSTANCE);
|
||||
JsonUtil.addRpcCompleteHandler(RpcStatus.INSTANCE);
|
||||
JsonUtil.setDefaultXsrfManager(new XsrfManager() {
|
||||
|
@@ -198,8 +198,6 @@ public interface GerritCss extends CssResource {
|
||||
String rightBorder();
|
||||
String rightmost();
|
||||
String rpcStatus();
|
||||
String rpcStatusLoading();
|
||||
String rpcStatusPanel();
|
||||
String screen();
|
||||
String screenHeader();
|
||||
String screenNoHeader();
|
||||
|
@@ -14,10 +14,9 @@
|
||||
|
||||
package com.google.gerrit.client;
|
||||
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.InlineLabel;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.google.gwt.user.client.ui.Panel;
|
||||
import com.google.gwt.user.client.ui.RootPanel;
|
||||
import com.google.gwtjsonrpc.client.event.RpcCompleteEvent;
|
||||
import com.google.gwtjsonrpc.client.event.RpcCompleteHandler;
|
||||
import com.google.gwtjsonrpc.client.event.RpcStartEvent;
|
||||
@@ -41,17 +40,12 @@ public class RpcStatus implements RpcStartHandler, RpcCompleteHandler {
|
||||
private final Label loading;
|
||||
private int activeCalls;
|
||||
|
||||
RpcStatus(final Panel p) {
|
||||
final FlowPanel r = new FlowPanel();
|
||||
r.setStyleName(Gerrit.RESOURCES.css().rpcStatusPanel());
|
||||
p.add(r);
|
||||
|
||||
RpcStatus() {
|
||||
loading = new InlineLabel();
|
||||
loading.setText(Gerrit.C.rpcStatusWorking());
|
||||
loading.setStyleName(Gerrit.RESOURCES.css().rpcStatus());
|
||||
loading.addStyleName(Gerrit.RESOURCES.css().rpcStatusLoading());
|
||||
loading.setVisible(false);
|
||||
r.add(loading);
|
||||
RootPanel.get().add(loading);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -360,25 +360,18 @@ a:hover {
|
||||
}
|
||||
|
||||
/** RPC Status **/
|
||||
.rpcStatusPanel {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
float: left;
|
||||
top: 6px;
|
||||
}
|
||||
|
||||
.rpcStatus {
|
||||
position: fixed;
|
||||
top: 6px;
|
||||
left: 50%;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.rpcStatusLoading {
|
||||
background: #FFF1A8;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user