Relocate setting page base to app initialization
Previously the page base was set on router load time. This meant that a base url needed to be set before the router code was evaluated by the browser. Now the router javascript can run and the base url will be set when the router is initialized instead of when the router code is initially executed. This small timing tweak allows for the polygerrit code to be loaded into the browser and change the base url before starting the polygerrit-ui. Change-Id: Ie89b5491877b7ab4ef285cba3babc4ee0c9087f9
This commit is contained in:
@@ -33,16 +33,16 @@
|
||||
getReporting().pageLoaded();
|
||||
};
|
||||
|
||||
var base = window.Gerrit.BaseUrlBehavior.getBaseUrl();
|
||||
if (base) {
|
||||
page.base(base);
|
||||
}
|
||||
|
||||
window.addEventListener('WebComponentsReady', function() {
|
||||
getReporting().timeEnd('WebComponentsReady');
|
||||
});
|
||||
|
||||
function startRouter() {
|
||||
var base = window.Gerrit.BaseUrlBehavior.getBaseUrl();
|
||||
if (base) {
|
||||
page.base(base);
|
||||
}
|
||||
|
||||
var restAPI = document.createElement('gr-rest-api-interface');
|
||||
var reporting = getReporting();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user