Merge "Remove HostPageData from the DOM after load"
This commit is contained in:
@@ -46,6 +46,7 @@ import com.google.gwt.core.client.EntryPoint;
|
|||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.core.client.JavaScriptObject;
|
import com.google.gwt.core.client.JavaScriptObject;
|
||||||
import com.google.gwt.dom.client.AnchorElement;
|
import com.google.gwt.dom.client.AnchorElement;
|
||||||
|
import com.google.gwt.dom.client.Document;
|
||||||
import com.google.gwt.event.logical.shared.ValueChangeEvent;
|
import com.google.gwt.event.logical.shared.ValueChangeEvent;
|
||||||
import com.google.gwt.event.logical.shared.ValueChangeHandler;
|
import com.google.gwt.event.logical.shared.ValueChangeHandler;
|
||||||
import com.google.gwt.http.client.URL;
|
import com.google.gwt.http.client.URL;
|
||||||
@@ -371,6 +372,7 @@ public class Gerrit implements EntryPoint {
|
|||||||
final HostPageDataService hpd = GWT.create(HostPageDataService.class);
|
final HostPageDataService hpd = GWT.create(HostPageDataService.class);
|
||||||
hpd.load(new GerritCallback<HostPageData>() {
|
hpd.load(new GerritCallback<HostPageData>() {
|
||||||
public void onSuccess(final HostPageData result) {
|
public void onSuccess(final HostPageData result) {
|
||||||
|
Document.get().getElementById("gerrit_hostpagedata").removeFromParent();
|
||||||
myConfig = result.config;
|
myConfig = result.config;
|
||||||
myTheme = result.theme;
|
myTheme = result.theme;
|
||||||
if (result.account != null) {
|
if (result.account != null) {
|
||||||
|
@@ -288,6 +288,7 @@ public class HostPageServlet extends HttpServlet {
|
|||||||
|
|
||||||
Element nocache = HtmlDomUtil.find(hostDoc, "gerrit_module");
|
Element nocache = HtmlDomUtil.find(hostDoc, "gerrit_module");
|
||||||
asScript(nocache);
|
asScript(nocache);
|
||||||
|
nocache.removeAttribute("id");
|
||||||
nocache.setAttribute("src", noCacheName);
|
nocache.setAttribute("src", noCacheName);
|
||||||
permutations.put(null, new Content(hostDoc));
|
permutations.put(null, new Content(hostDoc));
|
||||||
}
|
}
|
||||||
@@ -305,7 +306,6 @@ public class HostPageServlet extends HttpServlet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void asScript(final Element scriptNode) {
|
private void asScript(final Element scriptNode) {
|
||||||
scriptNode.removeAttribute("id");
|
|
||||||
scriptNode.setAttribute("type", "text/javascript");
|
scriptNode.setAttribute("type", "text/javascript");
|
||||||
scriptNode.setAttribute("language", "javascript");
|
scriptNode.setAttribute("language", "javascript");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user