Create elements after imports are resolved
This is better fix for Safari run-time exception. Bug: Issue 4438 Change-Id: I25fd1aa47293f299d1a52c082e403ca95e036de0
This commit is contained in:
@@ -15,7 +15,7 @@ limitations under the License.
|
||||
-->
|
||||
<link rel="import" href="../../../bower_components/polymer/polymer.html">
|
||||
<link rel="import" href="../../shared/gr-rest-api-interface/gr-rest-api-interface.html">
|
||||
<link rel="import" href="../../core/gr-reporting/gr-reporting.html">
|
||||
<link rel="import" href="../gr-reporting/gr-reporting.html">
|
||||
|
||||
<script src="../../../bower_components/page/page.js"></script>
|
||||
<script src="gr-router.js"></script>
|
||||
|
||||
@@ -17,15 +17,15 @@
|
||||
// Polymer makes `app` intrinsically defined on the window by virtue of the
|
||||
// custom element having the id "app", but it is made explicit here.
|
||||
var app = document.querySelector('#app');
|
||||
var restAPI = document.createElement('gr-rest-api-interface');
|
||||
if (!app) {
|
||||
console.log('No gr-app found (running tests)');
|
||||
return;
|
||||
}
|
||||
|
||||
window.addEventListener('WebComponentsReady', function() {
|
||||
if (!app) {
|
||||
console.log('No gr-app found (runing in test mode)');
|
||||
return;
|
||||
}
|
||||
// TODO (viktard): Fix properly.
|
||||
var reporting = app.$.reporting;
|
||||
var restAPI = document.createElement('gr-rest-api-interface');
|
||||
var reporting = document.createElement('gr-reporting');
|
||||
|
||||
reporting.timeEnd('WebComponentsReady');
|
||||
reporting.pageLoaded();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user