Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix toolbar loading cause event listener to not work properly #843

Merged
merged 1 commit into from
Nov 25, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions system/Debug/Toolbar/toolbarloader.js.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

document.addEventListener('DOMContentLoaded', loadDoc, false);
document.addEventListener('DOMContentLoaded', loadDoc, false );

function loadDoc() {
var time = document.getElementById("debugbar_loader").getAttribute("data-time");
Expand All @@ -8,8 +8,10 @@ function loadDoc() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
var x = document.body.innerHTML;
document.body.innerHTML = x + this.responseText;
var toolbar = document.createElement( 'div' );
toolbar.setAttribute( 'id', 'toolbarContainer' );
toolbar.innerHTML = this.responseText;
document.body.appendChild( toolbar );
eval(document.getElementById("toolbar_js").innerHTML);
if (typeof ciDebugBar === 'object') {
ciDebugBar.init();
Expand Down