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);
|
gBody.add(body);
|
||||||
|
|
||||||
RpcStatus.INSTANCE = new RpcStatus(topMenu);
|
RpcStatus.INSTANCE = new RpcStatus();
|
||||||
JsonUtil.addRpcStartHandler(RpcStatus.INSTANCE);
|
JsonUtil.addRpcStartHandler(RpcStatus.INSTANCE);
|
||||||
JsonUtil.addRpcCompleteHandler(RpcStatus.INSTANCE);
|
JsonUtil.addRpcCompleteHandler(RpcStatus.INSTANCE);
|
||||||
JsonUtil.setDefaultXsrfManager(new XsrfManager() {
|
JsonUtil.setDefaultXsrfManager(new XsrfManager() {
|
||||||
|
@@ -198,8 +198,6 @@ public interface GerritCss extends CssResource {
|
|||||||
String rightBorder();
|
String rightBorder();
|
||||||
String rightmost();
|
String rightmost();
|
||||||
String rpcStatus();
|
String rpcStatus();
|
||||||
String rpcStatusLoading();
|
|
||||||
String rpcStatusPanel();
|
|
||||||
String screen();
|
String screen();
|
||||||
String screenHeader();
|
String screenHeader();
|
||||||
String screenNoHeader();
|
String screenNoHeader();
|
||||||
|
@@ -14,10 +14,9 @@
|
|||||||
|
|
||||||
package com.google.gerrit.client;
|
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.InlineLabel;
|
||||||
import com.google.gwt.user.client.ui.Label;
|
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.RpcCompleteEvent;
|
||||||
import com.google.gwtjsonrpc.client.event.RpcCompleteHandler;
|
import com.google.gwtjsonrpc.client.event.RpcCompleteHandler;
|
||||||
import com.google.gwtjsonrpc.client.event.RpcStartEvent;
|
import com.google.gwtjsonrpc.client.event.RpcStartEvent;
|
||||||
@@ -41,17 +40,12 @@ public class RpcStatus implements RpcStartHandler, RpcCompleteHandler {
|
|||||||
private final Label loading;
|
private final Label loading;
|
||||||
private int activeCalls;
|
private int activeCalls;
|
||||||
|
|
||||||
RpcStatus(final Panel p) {
|
RpcStatus() {
|
||||||
final FlowPanel r = new FlowPanel();
|
|
||||||
r.setStyleName(Gerrit.RESOURCES.css().rpcStatusPanel());
|
|
||||||
p.add(r);
|
|
||||||
|
|
||||||
loading = new InlineLabel();
|
loading = new InlineLabel();
|
||||||
loading.setText(Gerrit.C.rpcStatusWorking());
|
loading.setText(Gerrit.C.rpcStatusWorking());
|
||||||
loading.setStyleName(Gerrit.RESOURCES.css().rpcStatus());
|
loading.setStyleName(Gerrit.RESOURCES.css().rpcStatus());
|
||||||
loading.addStyleName(Gerrit.RESOURCES.css().rpcStatusLoading());
|
|
||||||
loading.setVisible(false);
|
loading.setVisible(false);
|
||||||
r.add(loading);
|
RootPanel.get().add(loading);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -360,25 +360,18 @@ a:hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** RPC Status **/
|
/** RPC Status **/
|
||||||
.rpcStatusPanel {
|
|
||||||
position: absolute;
|
|
||||||
left: 50%;
|
|
||||||
float: left;
|
|
||||||
top: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rpcStatus {
|
.rpcStatus {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
top: 6px;
|
||||||
|
left: 50%;
|
||||||
padding-top: 4px;
|
padding-top: 4px;
|
||||||
padding-bottom: 4px;
|
padding-bottom: 4px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
|
||||||
|
|
||||||
.rpcStatusLoading {
|
|
||||||
background: #FFF1A8;
|
background: #FFF1A8;
|
||||||
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user