1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

Fixed the "Uncaught TypeError: Cannot read property 'className' of null" bug that appears when creating folders

This commit is contained in:
Alan Richey
2017-10-12 10:56:07 -05:00
parent 6a3062709c
commit 7c9596308e

View File

@@ -27,7 +27,10 @@ document.addEventListener('click', function (e) {
const className = e.target.className const className = e.target.className
if (!className && typeof (className) !== 'string') return if (!className && typeof (className) !== 'string') return
const isInfoButton = className.includes('infoButton') const isInfoButton = className.includes('infoButton')
const isInfoPanel = e.target.offsetParent.className.includes('infoPanel') let isInfoPanel = false
if (e.target.offsetParent !== null) {
isInfoPanel = e.target.offsetParent.className.includes('infoPanel')
}
if (isInfoButton || isInfoPanel) return if (isInfoButton || isInfoPanel) return
const infoPanel = document.querySelector('.infoPanel') const infoPanel = document.querySelector('.infoPanel')
if (infoPanel) infoPanel.style.display = 'none' if (infoPanel) infoPanel.style.display = 'none'