Skip to content

Commit

Permalink
Fix buggy scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
Heath123 committed Dec 18, 2020
1 parent 0d52165 commit 38aef4c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions html/mainPage/js/packetDom.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ function trimData (data) { // Function to trim the size of stringified data for
}

function addPacketToDOM (packet) {
const isHidden = filteringLogic.packetFilteredByFilterBox(packet, sharedVars.lastFilter, sharedVars.hiddenPackets)
sharedVars.allPacketsHTML.push([
`<li id="packet${packet.uid}" onclick="packetClick(${packet.uid})" class="packet ${packet.direction} ${
filteringLogic.packetFilteredByFilterBox(packet, sharedVars.lastFilter, sharedVars.hiddenPackets) ? 'filter-hidden' : 'filter-shown'
}">
`<li id="packet${packet.uid}" onclick="packetClick(${packet.uid})" class="packet ${packet.direction} ${isHidden ? 'filter-hidden' : 'filter-shown'}">
<span class="id">${escapeHtml(packet.hexIdString)}</span>
<span class="name">${escapeHtml(packet.meta.name)}</span>
<span class="data">${escapeHtml(trimData(packet.data))}</span>
Expand All @@ -46,7 +45,9 @@ function addPacketToDOM (packet) {
sharedVars.packetList.parentElement.scrollTop = sharedVars.packetList.parentElement.scrollHeight;
}
} */
sharedVars.packetsUpdated = true
if (!isHidden) {
sharedVars.packetsUpdated = true
}

updateHidden()
}
Expand Down

0 comments on commit 38aef4c

Please sign in to comment.