From 05d1013699142d2de284ddbee55af6a1fd27197c Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 2 Dec 2017 17:17:43 +0300 Subject: [PATCH] fixup 2e03c9c9: the element should be in DOM before reposition() --- vendor-overwrites/colorpicker/colorpicker.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vendor-overwrites/colorpicker/colorpicker.js b/vendor-overwrites/colorpicker/colorpicker.js index c03e9e7e..511a08dd 100644 --- a/vendor-overwrites/colorpicker/colorpicker.js +++ b/vendor-overwrites/colorpicker/colorpicker.js @@ -197,6 +197,12 @@ $formatChangeButton.title = opt.tooltipForSwitcher || ''; opt.hideDelay = Math.max(0, opt.hideDelay) || 2000; + $root.classList.add(CSS_PREFIX + 'theme-' + + (opt.theme === 'dark' || opt.theme === 'light' ? + opt.theme : + guessTheme())); + document.body.appendChild($root); + if (!isNaN(options.left) && !isNaN(options.top)) { $root.style = ` display: block; @@ -205,12 +211,6 @@ reposition(); } - $root.classList.add(CSS_PREFIX + 'theme-' + - (opt.theme === 'dark' || opt.theme === 'light' ? - opt.theme : - guessTheme())); - document.body.appendChild($root); - shown = true; registerEvents();