From a25d0a4c0583b96b88bd4da33c6ffab01900345a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sat, 30 Sep 2017 15:22:47 +0200 Subject: [PATCH] Fix https://github.com/espterm/espterm-firmware/issues/226 foreach on node list --- js/term/themes.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/term/themes.js b/js/term/themes.js index 5cab5ca..699c017 100644 --- a/js/term/themes.js +++ b/js/term/themes.js @@ -1,3 +1,4 @@ +const $ = require('../lib/chibi') const themes = exports.themes = [ [ // 0 - Tango - terminator @@ -99,12 +100,12 @@ exports.SELECTION_FG = '#333' exports.SELECTION_BG = '#b2d7fe' exports.themePreview = function (themeN) { - document.querySelectorAll('[data-fg]').forEach((elem) => { + $('[data-fg]').forEach((elem) => { let shade = elem.dataset.fg if (/^\d+$/.test(shade)) shade = exports.toCss(shade, themeN) elem.style.color = shade }) - document.querySelectorAll('[data-bg]').forEach((elem) => { + $('[data-bg]').forEach((elem) => { let shade = elem.dataset.bg if (/^\d+$/.test(shade)) shade = exports.toCss(shade, themeN) elem.style.backgroundColor = shade