|
55 | 55 | this.reposition(); |
56 | 56 | }); |
57 | 57 |
|
58 | | - forEach(elem.querySelectorAll('.tracy-icons a'), link => { |
| 58 | + elem.querySelectorAll('.tracy-icons a').forEach(link => { |
59 | 59 | link.addEventListener('click', e => { |
60 | 60 | clearTimeout(elem.Tracy.displayTimeout); |
61 | 61 | if (link.rel === 'close') { |
|
252 | 252 |
|
253 | 253 |
|
254 | 254 | initTabs(elem) { |
255 | | - forEach(elem.getElementsByTagName('a'), link => { |
| 255 | + elem.querySelectorAll('a').forEach(link => { |
256 | 256 | link.addEventListener('click', e => { |
257 | 257 | if (link.rel === 'close') { |
258 | 258 | this.close(); |
|
307 | 307 |
|
308 | 308 | autoHideLabels() { |
309 | 309 | var width = getWindowSize().width; |
310 | | - forEach(this.elem.children, function (ul) { |
| 310 | + Array.from(this.elem.children).forEach(ul => { |
311 | 311 | var labels = ul.querySelectorAll('.tracy-label'); |
312 | 312 | for (var i = labels.length - 1; i >= 0 && ul.clientWidth >= width; i--) { |
313 | 313 | labels.item(i).hidden = true; |
|
368 | 368 | Debug.layer.style.display = 'block'; |
369 | 369 | Debug.bar.init(); |
370 | 370 |
|
371 | | - forEach(document.querySelectorAll('.tracy-panel'), panel => { |
| 371 | + document.querySelectorAll('.tracy-panel').forEach(panel => { |
372 | 372 | Debug.panels[panel.id] = new Panel(panel.id); |
373 | 373 | Debug.panels[panel.id].dumps = dumps; |
374 | 374 | Debug.panels[panel.id].restorePosition(); |
|
380 | 380 |
|
381 | 381 |
|
382 | 382 | static loadAjax(content, dumps) { |
383 | | - forEach(Debug.layer.querySelectorAll('.tracy-panel.tracy-ajax'), panel => { |
| 383 | + Debug.layer.querySelectorAll('.tracy-panel.tracy-ajax').forEach(panel => { |
384 | 384 | Debug.panels[panel.id].savePosition(); |
385 | 385 | delete Debug.panels[panel.id]; |
386 | 386 | panel.parentNode.removeChild(panel); |
|
396 | 396 | ajaxBar = document.getElementById('tracy-ajax-bar'); |
397 | 397 | Debug.bar.elem.appendChild(ajaxBar); |
398 | 398 |
|
399 | | - forEach(document.querySelectorAll('.tracy-panel'), panel => { |
| 399 | + document.querySelectorAll('.tracy-panel').forEach(panel => { |
400 | 400 | if (!Debug.panels[panel.id]) { |
401 | 401 | Debug.panels[panel.id] = new Panel(panel.id); |
402 | 402 | Debug.panels[panel.id].dumps = dumps; |
|
491 | 491 |
|
492 | 492 |
|
493 | 493 | function evalScripts(elem) { |
494 | | - forEach(elem.getElementsByTagName('script'), script => { |
| 494 | + elem.querySelectorAll('script').forEach(script => { |
495 | 495 | if ((!script.hasAttribute('type') || script.type === 'text/javascript' || script.type === 'application/javascript') && !script.tracyEvaluated) { |
496 | 496 | var dolly = script.ownerDocument.createElement('script'); |
497 | 497 | dolly.textContent = script.textContent; |
|
579 | 579 | } |
580 | 580 | }; |
581 | 581 |
|
582 | | - forEach(options.handles, function (handle) { |
| 582 | + options.handles.forEach(handle => { |
583 | 583 | handle.addEventListener('mousedown', onStart); |
584 | 584 | handle.addEventListener('touchstart', onStart); |
585 | 585 |
|
|
638 | 638 | } |
639 | 639 |
|
640 | 640 |
|
641 | | - function forEach(arr, cb) { |
642 | | - Array.prototype.forEach.call(arr, cb); |
643 | | - } |
644 | | - |
645 | | - |
646 | 641 | if (document.currentScript) { |
647 | 642 | var nonce = document.currentScript.getAttribute('nonce') || document.currentScript.nonce; |
648 | 643 | var contentId = document.currentScript.dataset.id; |
|
0 commit comments