REFACTOR: querySelector instead of querySelectorAll to get first node (#8861)

This commit is contained in:
Joffrey JAFFEUX 2020-02-05 08:49:02 +01:00 committed by GitHub
parent a6da0bb1ef
commit a9f1652131
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -39,10 +39,8 @@ export default Component.extend(PanEvents, {
if (renderTimeline) {
const width = window.innerWidth,
composer = document.getElementById("reply-control"),
timelineContainer = document.querySelectorAll(
".timeline-container"
)[0],
headerContainer = document.querySelectorAll(".d-header")[0],
timelineContainer = document.querySelector(".timeline-container"),
headerContainer = document.querySelector(".d-header"),
headerHeight = (headerContainer && headerContainer.offsetHeight) || 0;
if (timelineContainer && composer) {