@@ -81,6 +81,11 @@ <h1>Opening library documentation failed</h1>
81
81
$ ( '.shortcuts a' ) . width ( 'max-content' ) ;
82
82
}
83
83
84
+ function toggleListStyle ( locator ) {
85
+ var separator = $ ( locator ) . text ( ) [ 0 ] ;
86
+ $ ( locator ) . html ( separator == '\u00b7' ? '<br>' : '·' ) ;
87
+ }
88
+
84
89
function handleKeyDown ( event ) {
85
90
event = event || window . event ;
86
91
var keyCode = event . keyCode || event . which ;
@@ -320,39 +325,44 @@ <h2 id="Importing">Importing</h2>
320
325
< script type ="text/x-jquery-tmpl " id ="shortcuts-template ">
321
326
< h2 id = "Shortcuts" > Shortcuts</ h2 >
322
327
{ { if keywords . length > 3 } }
323
- < span > Expanded shortcut list</ span >
324
- < label class = "switch" title = "Switch between compact list or expanded list" >
325
- < input type = "checkbox" class = "switch" onclick = "$('.shortcuts .all-in-one').toggle();$('.shortcuts .one-per-line').toggle();" >
328
+ < div class = "list-style-toggle" >
329
+ < b > List style:</ b > Compact
330
+ < label title = "Switch between compact list and expanded list" >
331
+ < input type = "checkbox" class = "switch" onclick = "toggleListStyle('.shortcut-separator');" >
326
332
< span class = "slider" > </ span >
327
333
</ label >
334
+ Expanded
335
+ </ div >
328
336
{ { / i f } }
329
337
< div class = 'shortcuts' >
330
- < div class = 'all-in-one' >
331
- { { each keywords} }
332
- < a href = "#${encodeURIComponent($value.name)}"
333
- class = "{{if $value.matched === false}}no-{{/if}}match"
334
- title = "${$value.shortdoc}" > ${ $value . name } </ a >
335
- { { if $index < keywords . length - 1 } } & middot ; { { / i f } }
336
- { { / each } }
337
- < / div >
338
- < div class = 'one-per-line' >
339
- { { each keywords} }
340
- < a href = "#${encodeURIComponent($value.name)}"
341
- class = "{{if $value.matched === false}}no-{{/if}}match"
342
- title = "${$value.shortdoc}" > ${ $value . name } </ a >
343
- { { if $index < keywords . length - 1 } } < br > { { / i f } }
344
- { { / e a c h } }
345
- </div >
338
+ { { each keywords} }
339
+ < a href = "#${encodeURIComponent($value.name)}"
340
+ class = "{{if $value.matched === false}}no-{{/if}}match"
341
+ title = "${$value.shortdoc}" > ${ $value . name } </ a >
342
+ { { if $index < keywords . length - 1 } }
343
+ < span class = "shortcut-separator" > ·</ span >
344
+ { { / i f } }
345
+ { { / e a c h } }
346
346
</div >
347
347
</ script >
348
348
349
349
< script type ="text/x-jquery-tmpl " id ="tags-template ">
350
350
< h2 id = "Tags" > Tags</ h2 >
351
+ { { if all_tags . length > 3 } }
352
+ < div class = "list-style-toggle" >
353
+ < b > List style:</ b > Compact
354
+ < label title = "Switch between compact list and expanded list" >
355
+ < input type = "checkbox" class = "switch" onclick = "toggleListStyle('.tag-separator');" >
356
+ < span class = "slider" > </ span >
357
+ </ label >
358
+ Expanded
359
+ </ div >
360
+ { { / i f } }
351
361
< div class = 'shortcuts' >
352
362
{ { each all_tags} }
353
363
< a href = "javascript:tagSearch('${$value}')"
354
364
title = "Show keywords with this tag" > ${ $value } </ a >
355
- & middot ;
365
+ < span class = "tag-separator" > ·</ span >
356
366
{ { / each} }
357
367
< a href = "javascript:resetKeywords()" class = "normal-first-letter"
358
368
title = "Show all keywords" > [Reset]</ a >
0 commit comments