Remove HostPageData from the DOM after load

Delete the <script> tag from the DOM after the data has been
consumed, making DOM inspection a bit less messy. Developers can
still see the original text with "view source" in their browser.

Change-Id: If8db067d2c92e823cbbb3cd0cdcc537e88c6f8ef
This commit is contained in:
Shawn O. Pearce
2012-10-11 21:57:53 -07:00
parent 4305d7134d
commit 6bb585832a
2 changed files with 3 additions and 1 deletions

View File

@@ -46,6 +46,7 @@ import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JavaScriptObject;
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.ValueChangeHandler;
import com.google.gwt.http.client.URL;
@@ -371,6 +372,7 @@ public class Gerrit implements EntryPoint {
final HostPageDataService hpd = GWT.create(HostPageDataService.class);
hpd.load(new GerritCallback<HostPageData>() {
public void onSuccess(final HostPageData result) {
Document.get().getElementById("gerrit_hostpagedata").removeFromParent();
myConfig = result.config;
myTheme = result.theme;
if (result.account != null) {