From 57bdccf7dc8fa7200b56526311af87c48e5b493f Mon Sep 17 00:00:00 2001 From: Ryo Hilmawan <54142180+CloudHill@users.noreply.github.com> Date: Thu, 19 Nov 2020 03:09:17 +0700 Subject: [PATCH] Update mod.js (#270) --- repo/notion-icons/mod.js | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/repo/notion-icons/mod.js b/repo/notion-icons/mod.js index 5c83a1e..6bd8587 100644 --- a/repo/notion-icons/mod.js +++ b/repo/notion-icons/mod.js @@ -177,25 +177,31 @@ module.exports = { : `${iconData.sourceUrl}/${iconData.source}_${i}.${iconData.extension}` : iconData.source[i]; - const icon = createElement(`
`); - - iconSetBody.append(icon); - garbageCollector.push(icon); - icon.addEventListener('click', () => setPageIcon(iconUrl)); - - // Make sure elements load - promiseArray.push( - new Promise((resolve, reject) => { + const icon = createElement(``); + if (iconData.enhancerIcons) { + // Load sprite sheet + icon.innerHTML = + ``; + } else { + icon.innerHTML = `