fixup 2e03c9c9: the element should be in DOM before reposition()
This commit is contained in:
parent
d263bc8e55
commit
05d1013699
|
@ -197,6 +197,12 @@
|
||||||
$formatChangeButton.title = opt.tooltipForSwitcher || '';
|
$formatChangeButton.title = opt.tooltipForSwitcher || '';
|
||||||
opt.hideDelay = Math.max(0, opt.hideDelay) || 2000;
|
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)) {
|
if (!isNaN(options.left) && !isNaN(options.top)) {
|
||||||
$root.style = `
|
$root.style = `
|
||||||
display: block;
|
display: block;
|
||||||
|
@ -205,12 +211,6 @@
|
||||||
reposition();
|
reposition();
|
||||||
}
|
}
|
||||||
|
|
||||||
$root.classList.add(CSS_PREFIX + 'theme-' +
|
|
||||||
(opt.theme === 'dark' || opt.theme === 'light' ?
|
|
||||||
opt.theme :
|
|
||||||
guessTheme()));
|
|
||||||
document.body.appendChild($root);
|
|
||||||
|
|
||||||
shown = true;
|
shown = true;
|
||||||
|
|
||||||
registerEvents();
|
registerEvents();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user