1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Fixed the "Uncaught TypeError: Cannot read property 'className' of null" bug that appears when creating folders (coding style adjustments)

This commit is contained in:
Alan Richey
2017-10-13 09:30:41 -05:00
parent 7c9596308e
commit 590aa9ab17

View File

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