Skip to content

Commit

Permalink
[WebProfilerBundle] Fix javascript toolbar on IE8
Browse files Browse the repository at this point in the history
  • Loading branch information
romainneutron committed Mar 19, 2015
1 parent d64cb49 commit cbd89f5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
Expand Up @@ -4,6 +4,17 @@
var noop = function() {},
collectionToArray = function (collection) {
var length = collection.length || 0,
results = new Array(length);
while (length--) {
results[length] = collection[length];
}
return results;
},
profilerStorageKey = 'sf2/profiler/',
request = function(url, onSuccess, onError, payload, options) {
Expand Down Expand Up @@ -131,13 +142,13 @@
}
} else if (request.loading) {
requestState = 'loading';
state = 'loading'
state = 'loading';
}
row.className = 'sf-ajax-request sf-ajax-request-' + requestState;
}
var infoSpan = document.querySelectorAll(".sf-toolbar-ajax-info")[0];
var children = Array.prototype.slice.call(tbody.children);
var children = collectionToArray(tbody.children);
for (var i = 0; i < children.length; i++) {
tbody.removeChild(children[i]);
}
Expand Down Expand Up @@ -185,7 +196,7 @@
}
{% if excluded_ajax_paths is defined %}
if (window.XMLHttpRequest) {
if (window.XMLHttpRequest && XMLHttpRequest.addEventListener) {
var proxied = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
Expand Down Expand Up @@ -262,9 +273,7 @@
},
toggle: function(selector, elOn, elOff) {
var i,
style,
tmp = elOn.style.display,
var tmp = elOn.style.display,
el = document.getElementById(selector);
elOn.style.display = elOff.style.display;
Expand Down
Expand Up @@ -33,10 +33,10 @@
Sfjs.renderAjaxRequests();
/* Handle toolbar-info position */
var toolbarBlocks = document.getElementsByClassName('sf-toolbar-block');
var toolbarBlocks = document.querySelectorAll('.sf-toolbar-block');
for (var i = 0; i < toolbarBlocks.length; i += 1) {
toolbarBlocks[i].onmouseover = function () {
var toolbarInfo = this.getElementsByClassName('sf-toolbar-info')[0];
var toolbarInfo = this.querySelectorAll('.sf-toolbar-info')[0];
var pageWidth = document.body.clientWidth;
var elementWidth = toolbarInfo.offsetWidth;
var leftValue = (elementWidth + this.offsetLeft) - pageWidth;
Expand Down

0 comments on commit cbd89f5

Please sign in to comment.