File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 139
139
}
140
140
}
141
141
142
-
143
142
function guessThemeColor ( ) {
144
143
const meta = document . head . querySelector ( 'meta[name="theme-color"]' )
145
144
if ( meta ) {
176
175
} ,
177
176
}
178
177
178
+ function isEmpty ( input ) {
179
+ if ( input ) {
180
+ return Object . keys ( input ) . length > 0
181
+ }
182
+ return true
183
+ }
184
+
179
185
// ---------------- TocBar ----------------------
180
186
const TOC_BAR_STYLE = `
181
187
.toc-bar {
@@ -365,7 +371,7 @@ a.toc-link {
365
371
this . element . appendChild ( tocElement )
366
372
367
373
const cachedPosition = POSITION_STORAGE . get ( options . siteName )
368
- if ( cachedPosition ) {
374
+ if ( ! isEmpty ( cachedPosition ) ) {
369
375
this . element . style . top = `${ cachedPosition . top } px`
370
376
this . element . style . right = `${ cachedPosition . right } px`
371
377
} else if ( options . hasOwnProperty ( 'initialTop' ) ) {
You can’t perform that action at this time.
0 commit comments