@@ -46,10 +46,10 @@ <h1>Opening library documentation failed</h1>
46
46
renderTemplate ( 'importing' , libdoc ) ;
47
47
}
48
48
renderTemplate ( 'shortcuts' , libdoc ) ;
49
- initShortcutListStyle ( 'shortcut' ) ;
49
+ initShortcutListStyle ( 'shortcut' , libdoc . keywords ) ;
50
50
if ( libdoc . contains_tags ) {
51
51
renderTemplate ( 'tags' , libdoc ) ;
52
- initShortcutListStyle ( 'tag' ) ;
52
+ initShortcutListStyle ( 'tag' , libdoc . all_tags ) ;
53
53
}
54
54
renderTemplate ( 'keywords' , libdoc ) ;
55
55
renderTemplate ( 'footer' , libdoc ) ;
@@ -85,8 +85,9 @@ <h1>Opening library documentation failed</h1>
85
85
$ ( '.shortcuts a' ) . width ( 'max-content' ) ;
86
86
}
87
87
88
- function initShortcutListStyle ( name ) {
89
- if ( storage . get ( name + '-list-style' , 'compact' ) != 'compact' ) {
88
+ function initShortcutListStyle ( name , items ) {
89
+ var style = storage . get ( name + '-list-style' , 'compact' ) ;
90
+ if ( style != 'compact' && items . length > 1 ) {
90
91
$ ( '.' + name + '-list-separator' ) . html ( '<br>' ) ;
91
92
$ ( '.' + name + '-list-toggle .switch' ) . prop ( 'checked' , true ) ;
92
93
}
@@ -336,7 +337,7 @@ <h2 id="Importing">Importing</h2>
336
337
337
338
< script type ="text/x-jquery-tmpl " id ="shortcuts-template ">
338
339
< h2 id = "Shortcuts" > Shortcuts</ h2 >
339
- { { if keywords . length > 3 } }
340
+ { { if keywords . length > 1 } }
340
341
< div class = "shortcut-list-toggle" >
341
342
< b > List style:</ b > Compact
342
343
< label title = "Switch between compact list and expanded list" >
@@ -360,7 +361,7 @@ <h2 id="Shortcuts">Shortcuts</h2>
360
361
361
362
< script type ="text/x-jquery-tmpl " id ="tags-template ">
362
363
< h2 id = "Tags" > Tags</ h2 >
363
- { { if all_tags . length > 3 } }
364
+ { { if all_tags . length > 1 } }
364
365
< div class = "tag-list-toggle" >
365
366
< b > List style:</ b > Compact
366
367
< label title = "Switch between compact list and expanded list" >
0 commit comments