|
56 | 56 | this.reposition(); |
57 | 57 | }); |
58 | 58 |
|
59 | | - forEach(elem.querySelectorAll('.tracy-icons a'), link => { |
| 59 | + elem.querySelectorAll('.tracy-icons a').forEach(link => { |
60 | 60 | link.addEventListener('click', e => { |
61 | 61 | clearTimeout(elem.Tracy.displayTimeout); |
62 | 62 | if (link.rel === 'close') { |
|
257 | 257 |
|
258 | 258 |
|
259 | 259 | initTabs(elem) { |
260 | | - forEach(elem.getElementsByTagName('a'), link => { |
| 260 | + elem.querySelectorAll('a').forEach(link => { |
261 | 261 | link.addEventListener('click', e => { |
262 | 262 | if (link.rel === 'close') { |
263 | 263 | this.close(); |
|
316 | 316 |
|
317 | 317 | autoHideLabels() { |
318 | 318 | var width = getWindowSize().width; |
319 | | - forEach(this.elem.children, function (ul) { |
| 319 | + Array.from(this.elem.children).forEach(ul => { |
320 | 320 | var labels = ul.querySelectorAll('.tracy-label'); |
321 | 321 | for (var i = labels.length - 1; i >= 0 && ul.clientWidth >= width; i--) { |
322 | 322 | labels.item(i).hidden = true; |
|
377 | 377 | Debug.layer.style.display = 'block'; |
378 | 378 | Debug.bar.init(); |
379 | 379 |
|
380 | | - forEach(document.querySelectorAll('.tracy-panel'), panel => { |
| 380 | + document.querySelectorAll('.tracy-panel').forEach(panel => { |
381 | 381 | Debug.panels[panel.id] = new Panel(panel.id); |
382 | 382 | Debug.panels[panel.id].dumps = dumps; |
383 | 383 | Debug.panels[panel.id].restorePosition(); |
|
389 | 389 |
|
390 | 390 |
|
391 | 391 | static loadAjax(content, dumps) { |
392 | | - forEach(Debug.layer.querySelectorAll('.tracy-panel.tracy-ajax'), panel => { |
| 392 | + Debug.layer.querySelectorAll('.tracy-panel.tracy-ajax').forEach(panel => { |
393 | 393 | Debug.panels[panel.id].savePosition(); |
394 | 394 | delete Debug.panels[panel.id]; |
395 | 395 | panel.parentNode.removeChild(panel); |
|
405 | 405 | ajaxBar = document.getElementById('tracy-ajax-bar'); |
406 | 406 | Debug.bar.elem.appendChild(ajaxBar); |
407 | 407 |
|
408 | | - forEach(document.querySelectorAll('.tracy-panel'), panel => { |
| 408 | + document.querySelectorAll('.tracy-panel').forEach(panel => { |
409 | 409 | if (!Debug.panels[panel.id]) { |
410 | 410 | Debug.panels[panel.id] = new Panel(panel.id); |
411 | 411 | Debug.panels[panel.id].dumps = dumps; |
|
500 | 500 |
|
501 | 501 |
|
502 | 502 | function evalScripts(elem) { |
503 | | - forEach(elem.getElementsByTagName('script'), script => { |
| 503 | + elem.querySelectorAll('script').forEach(script => { |
504 | 504 | if ((!script.hasAttribute('type') || script.type === 'text/javascript' || script.type === 'application/javascript') && !script.tracyEvaluated) { |
505 | 505 | var dolly = script.ownerDocument.createElement('script'); |
506 | 506 | dolly.textContent = script.textContent; |
|
588 | 588 | } |
589 | 589 | }; |
590 | 590 |
|
591 | | - forEach(options.handles, function (handle) { |
| 591 | + options.handles.forEach(handle => { |
592 | 592 | handle.addEventListener('mousedown', onStart); |
593 | 593 | handle.addEventListener('touchstart', onStart); |
594 | 594 |
|
|
647 | 647 | } |
648 | 648 |
|
649 | 649 |
|
650 | | - function forEach(arr, cb) { |
651 | | - Array.prototype.forEach.call(arr, cb); |
652 | | - } |
653 | | - |
654 | | - |
655 | 650 | if (document.currentScript) { |
656 | 651 | var nonce = document.currentScript.getAttribute('nonce') || document.currentScript.nonce; |
657 | 652 | var contentId = document.currentScript.dataset.id; |
|
0 commit comments