From 83698325858abd2a43ad0fe52f7779698ae6a6a4 Mon Sep 17 00:00:00 2001 From: asmsuechan Date: Sat, 22 Jul 2017 15:11:59 +0900 Subject: [PATCH] Fix a bug on click --- browser/main/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/browser/main/index.js b/browser/main/index.js index d36a4c9e..f75416c9 100644 --- a/browser/main/index.js +++ b/browser/main/index.js @@ -24,8 +24,9 @@ document.addEventListener('dragover', function (e) { }) document.addEventListener('click', function (e) { - if (!e.target.className) return - const isInfoButton = e.target.className.includes('infoButton') + const className = e.target.className + if (!className && typeof(className) !== 'string') return + const isInfoButton = className.includes('infoButton') const isInfoPanel = e.target.offsetParent.className.includes('infoPanel') if (isInfoButton || isInfoPanel) return const infoPanel = document.querySelector('.infoPanel')