From ef0f025c391d43f98f3142e2f367b6a95af55cf2 Mon Sep 17 00:00:00 2001 From: "http://jneen.net/" Date: Mon, 9 Dec 2019 12:48:29 -0500 Subject: [PATCH] fix and simplify the logic of details-polyfill-detect --- assets/js/details-polyfill-detect.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/assets/js/details-polyfill-detect.js b/assets/js/details-polyfill-detect.js index 0a4fcb3..19fc744 100644 --- a/assets/js/details-polyfill-detect.js +++ b/assets/js/details-polyfill-detect.js @@ -1,10 +1,5 @@ -const needsPolyfill = () => { - if (typeof Promise === 'function') return false - if (document.querySelector('details') !== null) return false - return true -} - -if (needsPolyfill()) { +if (typeof Promise !== "function" && + document.querySelector('details') !== null) { const script = '