elixir-toolkit-theme 1.26.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,11 +9,11 @@
9
9
  <i title="navbar-toggler" class="fa-solid fa-bars"></i>
10
10
  </button>
11
11
  <div class="collapse navbar-collapse justify-content-end" id="navbarCollapse">
12
- <ul class="navbar-nav">
12
+ <ul class="navbar-nav gap-2">
13
13
  <!-- navigation entries -->
14
14
  {%- assign topnav = site.data.topnav %}
15
15
  {%- for item in topnav.subitems %}
16
- <li class="nav-item {% if item.subitems %}dropdown {% endif %}ms-0 ms-lg-3 mt-2 mt-lg-0">
16
+ <li class="nav-item {% if item.subitems %}dropdown {% endif %}">
17
17
  {%- assign page_sidebar = page.sidebar | downcase | replace: "-", "_" | replace: " ", "_" %}
18
18
  {%- assign nav_title = item.title | downcase | replace: "-", "_" | replace: " ", "_" %}
19
19
  {%- if item.external_url %}
@@ -49,15 +49,15 @@
49
49
  {%- else %}
50
50
  {%- assign break_color = "light" %}
51
51
  {%- endif -%}
52
- <li class="nav-item ms-0 ms-lg-3 mt-2 mt-lg-0 nav-break bg-{{break_color}} opacity-25"></li>
52
+ <li class="nav-item nav-break bg-{{break_color}} opacity-25"></li>
53
53
  {%- endif %}
54
54
  {%- if site.theme_variables.topnav.twitter %}
55
- <li class="nav-item ms-0 ms-lg-3 mt-2 mt-lg-0">
55
+ <li class="nav-item">
56
56
  <a class="nav-link ps-2 d-flex align-items-center" href="{{site.theme_variables.topnav.twitter}}"><i class="fa-brands fa-twitter me-2"></i>Twitter</a>
57
57
  </li>
58
58
  {%- endif %}
59
59
  {%- if site.theme_variables.topnav.github or site.theme_variables.topnav.github == nil %}
60
- <li class="nav-item ms-0 ms-lg-3 mt-2 mt-lg-0">
60
+ <li class="nav-item">
61
61
  <a class="nav-link ps-2 d-flex align-items-center" href="{{site.github.repository_url}}">
62
62
  {%- assign git_host = site.theme_variables.git_host | downcase %}
63
63
  {%- if git_host == 'gitlab' %}
@@ -71,7 +71,7 @@
71
71
  {%- endif %}
72
72
  {%- unless include.search == false %}
73
73
  <!--start search-->
74
- <li class="nav-item ms-0 ms-lg-3 my-2 my-lg-0">
74
+ <li class="nav-item">
75
75
  <div class="position-relative">
76
76
  <form role="search" class="input-group">
77
77
  <span class="input-group-text" id="search-label"><i class="fa-solid fa-magnifying-glass"></i></span><input type="search" id="search-input" class="search-input form-control" tabindex="0" placeholder="Search {{ site.title }}" aria-label="Search {{ site.title }}" autocomplete="off">
@@ -7,17 +7,13 @@
7
7
  <!-- Page Content -->
8
8
  <div class="container flex-grow-1">
9
9
  <!-- Content Row -->
10
- <div class="row gx-0 gx-lg-5">
11
- {%- assign content_col_size = "col-lg-12" %}{% unless page.hide_sidebar %}
12
- <!-- Sidebar Column -->
13
- <div class="col-lg-3 mb-0 mb-lg-4">
10
+ <div id="layout" class="gap-5">
11
+ <!-- Sidebar -->
12
+ <aside id="sidebar">
14
13
  {% include sidebar.html %}
15
- </div>
16
- {%- assign content_col_size = "col-lg-9" %}{% endunless %}
17
- <!-- Content Column -->
18
- <div class="{{content_col_size}}">
19
- {{content}}
20
- </div>
14
+ </aside>
15
+ <!-- Content -->
16
+ {{content}}
21
17
  </div>
22
18
  </div>
23
19
  {%- if site.theme_variables.back_to_top or site.theme_variables.back_to_top == nil %}
data/_layouts/page.html CHANGED
@@ -1,38 +1,43 @@
1
1
  ---
2
2
  layout: default
3
3
  ---
4
- <main id="main" class="mb-5">
5
- {%- if page.title %}
6
- {%- if page.type %}
7
- {%- assign subtitle = page.type | replace: "_", " " | capitalize %}
8
- <h1 class="has-subtitle"><span class="d-block text-secondary fs-4 ff-body">{{subtitle}}</span><span class="visually-hidden">:</span> {{ page.title }}
9
- {%- else %}
10
- <h1>{{ page.title }}
11
- {%- endif %}
12
- {%- if site.theme_variables.github_buttons.position == "top" or site.theme_variables.github_buttons.position == nil %}
13
- {% include github-buttons.html %}
14
- {%- endif %}
15
- </h1>
16
- {%- endif %}
17
- {%- if page.summary %}
18
- <div class="summary">{{page.summary}}</div>
19
- {%- endif %}
20
- {%- unless page.toc == false %}
21
- {%- include toc.html %}
22
- {%- endunless %}
23
- {{content}}
24
- {% include resource-table-page.html %}
25
- {% include related-pages.html %}
26
- {% include more-information-tiles.html %}
27
- {%- if page.page_id %}
28
- {% include resource-table-all.html tag=page.page_id %}
29
- {%- endif %}
30
- {% include affiliation-tiles-page.html %}
31
- {% include contributor-minitiles-page.html %}
32
- {%- if site.theme_variables.github_buttons.position == "bottom" %}
33
- <div id="github-buttons-wrapper" class="d-flex mt-5">
34
- {% include github-buttons.html %}
4
+ <main id="main" class="order-1">
5
+ <div id="intro">
6
+ {%- if page.title %}
7
+ {%- if page.type %}
8
+ {%- assign subtitle = page.type | replace: "_", " " | capitalize %}
9
+ <h1 class="has-subtitle"><span class="d-block text-secondary fs-4 ff-body">{{subtitle}}</span><span class="visually-hidden">:</span> {{ page.title }}
10
+ {%- else %}
11
+ <h1>{{ page.title }}
12
+ {%- endif %}
13
+ {%- if site.theme_variables.github_buttons.position == "top" or site.theme_variables.github_buttons.position == nil %}
14
+ {% include github-buttons.html %}
15
+ {%- endif %}
16
+ </h1>
17
+ {%- endif %}
18
+ {%- if page.summary %}
19
+ <div class="summary">{{page.summary}}</div>
20
+ {%- endif %}
21
+ </div>
22
+ <div id="toc" class="text-muted sticky-lg-top">
23
+ {%- include toc.html %}
24
+ </div>
25
+ <div id="content" class="mb-5" data-bs-spy="scroll" data-bs-target="#toc-contents" data-bs-smooth-scroll="true" tabindex="0">
26
+ {{content}}
27
+ {% include resource-table-page.html %}
28
+ {% include related-pages.html %}
29
+ {% include more-information-tiles.html %}
30
+ {%- if page.page_id %}
31
+ {% include resource-table-all.html tag=page.page_id %}
32
+ {%- endif %}
33
+ {% include affiliation-tiles-page.html %}
34
+ {% include contributor-minitiles-page.html %}
35
+ {%- if site.theme_variables.github_buttons.position == "bottom" %}
36
+ <div id="github-buttons-wrapper" class="d-flex mt-5">
37
+ {% include github-buttons.html %}
38
+ </div>
39
+ {%- endif %}
35
40
  </div>
36
- {%- endif %}
37
41
  </main>
38
42
 
43
+
@@ -1,4 +1,4 @@
1
- @import "bootstrap/functions";
1
+
2
2
 
3
3
  /*-----Theme colors-----*/
4
4
  $primary: #0d6efd;
@@ -8,5 +8,3 @@ $dark: #212529;
8
8
 
9
9
  /*-----Custom values for Bootstrap variables-----*/
10
10
  $link-decoration: none;
11
-
12
- @import "bootstrap/variables";
@@ -24,9 +24,6 @@ $sidebar-lvl3-color: $dark;
24
24
  $sidebar-bg-active: $primary;
25
25
  $sidebar-color-active: $white;
26
26
 
27
- /*-----TOC-----*/
28
- $toc-bg: $light;
29
-
30
27
  /*-----Section navigation tiles-----*/
31
28
  $nav-card-bg: $light;
32
29
  $nav-card-header-bg: $secondary;
data/assets/css/main.scss CHANGED
@@ -1,23 +1,34 @@
1
1
  ---
2
2
  layout: none
3
- permalink: assets/css/main.css
3
+ permalink: assets/css/main
4
4
  ---
5
5
 
6
6
  /*-----Default theme variables-----*/
7
+
8
+ @import "bootstrap/functions";
7
9
  $popover-max-width: 12em;
8
10
  $enable-caret: false;
9
11
  $card-border-width: 0;
12
+ $custom-container-max-widths: (
13
+ xxxl: 1500px,
14
+ );
10
15
 
11
- /*-----Include other SASS files-----*/
16
+ /*-----Initialize Bootstrap variables-----*/
12
17
 
13
18
  @import "bootstrap_variables";
19
+ @import "bootstrap/variables";
20
+
21
+ /*-----Custom maps-----*/
22
+ $container-max-widths: map-merge($container-max-widths, $custom-container-max-widths);
23
+
24
+ /*-----Include other SASS files-----*/
14
25
  @import "bootstrap/bootstrap";
15
26
  @import "variables";
16
27
  @import "custom_variables";
17
28
 
18
29
  /*-----General styling-----*/
19
30
 
20
- main {
31
+ #content {
21
32
  h1 {
22
33
  font-family: $font-family-theme;
23
34
  font-weight: 400;
@@ -67,10 +78,10 @@ main {
67
78
  font-weight: 600;
68
79
  }
69
80
  }
81
+ }
70
82
 
71
- img {
72
- @extend .img-fluid;
73
- }
83
+ body img {
84
+ @extend .img-fluid;
74
85
  }
75
86
 
76
87
  .ff-body {
@@ -81,6 +92,78 @@ main {
81
92
  font-family: $font-family-theme !important;
82
93
  }
83
94
 
95
+ /*-----Layout-----*/
96
+
97
+ #main {
98
+ grid-area: main;
99
+ }
100
+
101
+
102
+
103
+ @include media-breakpoint-up(md) {
104
+ #main {
105
+ display: grid;
106
+ grid-template-areas:
107
+ "intro"
108
+ "toc"
109
+ "content";
110
+ grid-template-rows: auto auto 1fr;
111
+ }
112
+ }
113
+ @include media-breakpoint-up(lg) {
114
+ #main {
115
+ grid-template-areas:
116
+ "intro toc"
117
+ "content toc";
118
+ grid-template-rows: auto 1fr;
119
+ }
120
+
121
+ .add-grid {
122
+ grid-template-columns: 5fr 2fr;
123
+ }
124
+ }
125
+
126
+ #toc {
127
+ grid-area: toc;
128
+ display: none;
129
+ }
130
+
131
+ @include media-breakpoint-up(lg) {
132
+ #toc {
133
+ top: $spacer * 3;
134
+ right: 0;
135
+ z-index: 2;
136
+ height: calc(100vh - 7rem);
137
+ overflow-y: auto;
138
+ margin-left: $spacer * 3;
139
+ }
140
+ }
141
+
142
+ #intro {
143
+ grid-area: intro;
144
+ }
145
+
146
+ #sidebar {
147
+ grid-area: sidebar;
148
+ }
149
+
150
+ #content {
151
+ grid-area: content;
152
+ min-width: 1px;
153
+ position: relative;
154
+ h2:first-child {
155
+ margin-top: 0;
156
+ }
157
+ }
158
+
159
+ @include media-breakpoint-up(lg) {
160
+ #layout {
161
+ display: grid;
162
+ grid-template-areas: "sidebar main";
163
+ grid-template-columns: 2fr 9fr;
164
+ }
165
+ }
166
+
84
167
  /*-----Blockquote-----*/
85
168
 
86
169
  blockquote {
@@ -153,7 +236,7 @@ header .navbar {
153
236
  color: $topnav-title-color;
154
237
 
155
238
  img {
156
- height: $topnav-brand-height;
239
+ max-height: $topnav-brand-height;
157
240
  }
158
241
  }
159
242
  }
@@ -169,7 +252,7 @@ header .navbar {
169
252
  font-weight: 900;
170
253
  margin-left: 0.25rem;
171
254
  content: "\f0d7";
172
- transition: transform 0.2s ease-in-out;
255
+ transition: transform 0.15s ease-in-out;
173
256
  }
174
257
 
175
258
  .dropdown-toggle[aria-expanded="true"]::after {
@@ -292,15 +375,14 @@ header .navbar {
292
375
  /*-----Sidebar-----*/
293
376
 
294
377
  @include media-breakpoint-up(lg) {
295
- #side-nav {
378
+ #sidebar > nav {
296
379
  display: block !important;
297
380
  }
298
381
  }
299
382
 
300
- #side-nav .btn.sidebar-title {
383
+ #sidebar > nav .btn.sidebar-title {
301
384
  color: $sidebar-color;
302
- background-color: transparent;
303
- border-color: transparent;
385
+ border: 0;
304
386
  }
305
387
 
306
388
  .sidebar-collapse {
@@ -318,7 +400,7 @@ header .navbar {
318
400
  background-color: $sidebar-bg-active;
319
401
  }
320
402
 
321
- #side-nav > ul {
403
+ #sidebar > nav > ul {
322
404
  > li:not(.sidebar-title) > a {
323
405
  background-color: $sidebar-bg;
324
406
  color: $sidebar-color;
@@ -341,7 +423,7 @@ header .navbar {
341
423
  font-family: "Font Awesome 6 Free";
342
424
  font-weight: 900;
343
425
  content: "\f078";
344
- transition: transform 0.2s ease-in-out;
426
+ transition: transform 0.15s ease-in-out;
345
427
  }
346
428
  }
347
429
 
@@ -391,25 +473,32 @@ header .navbar {
391
473
 
392
474
  /*-----TOC-----*/
393
475
 
394
- #toc {
395
- background-color: $toc-bg;
396
- // Indent the lists and reset any other padding
397
-
476
+ #toc-contents {
477
+ @include media-breakpoint-up(lg) {
478
+ display: block !important;
479
+ } // Indent the lists and reset any other padding
398
480
  ul {
399
- padding: 0 0 0 20px;
481
+ // highlighting active links
482
+ a {
483
+ color: inherit;
484
+ padding-left: 0.25rem;
485
+ border-left: 0.125rem solid transparent;
486
+ display: block;
487
+ transition: border-left 0.15s ease-in-out;
488
+ &.active,
489
+ &:hover {
490
+ text-decoration: none !important;
491
+ border-left: 0.125rem solid $primary;
492
+ color: $primary;
493
+ }
494
+ }
400
495
  }
401
496
 
402
497
  // Consistent vertical space between list items
403
498
 
404
499
  li,
405
500
  ul ul li {
406
- margin: 8px 0 0 0;
407
- }
408
-
409
- // Sublists
410
-
411
- ul ul {
412
- list-style: circle outside;
501
+ margin: 13px 0 0 0;
413
502
  }
414
503
  }
415
504
 
@@ -495,11 +584,11 @@ footer {
495
584
  }
496
585
 
497
586
  #ett-logo {
498
- transition: color .15s ease-in-out;
587
+ transition: color 0.15s ease-in-out;
499
588
 
500
589
  .cls-1 {
501
590
  fill: $footer-ett;
502
- transition: fill .15s ease-in-out;
591
+ transition: fill 0.15s ease-in-out;
503
592
  }
504
593
  &:hover {
505
594
  .cls-1 {
@@ -552,17 +641,31 @@ footer {
552
641
  }
553
642
 
554
643
  @include media-breakpoint-down(md) {
555
- #contributors-carousel .card-title {
556
- font-size: 0.5em;
557
- }
644
+ #contributors-carousel {
645
+ .card-title {
646
+ font-size: 0.5em;
647
+ }
558
648
 
559
- #contributors-carousel .card-affiliation {
560
- color: $primary;
561
- font-size: 0.4em;
562
- }
649
+ .card-affiliation,
650
+ .badge {
651
+ font-size: 0.4em;
652
+ }
653
+
654
+ .card-body,
655
+ .card-footer {
656
+ padding: 0.5rem 0.25rem;
657
+ }
563
658
 
564
- #contributors-carousel .card-body {
565
- padding: 0rem 0.5rem 0.5rem 0.5rem;
659
+ .social-icons {
660
+ line-height: 2ex;
661
+ width: 2.2ex;
662
+ height: 2.2ex;
663
+ i {
664
+ font-size: 0.625em;
665
+ line-height: 0.1em;
666
+ vertical-align: 0.225em;
667
+ }
668
+ }
566
669
  }
567
670
  }
568
671
 
@@ -587,14 +690,6 @@ footer {
587
690
  text-align: center;
588
691
  }
589
692
 
590
- @include media-breakpoint-down(md) {
591
- #contributors-carousel .social-icons {
592
- line-height: 1.2ex;
593
- width: 1.2ex;
594
- height: 1.2ex;
595
- }
596
- }
597
-
598
693
  /*--------Page contributors---------*/
599
694
  .page-contributors {
600
695
  background-color: $contr-bg;
@@ -669,6 +764,30 @@ footer {
669
764
  transition-delay: 1000ms;
670
765
  }
671
766
 
767
+ /*-----Tools-----*/
768
+
769
+ .tool {
770
+ cursor: pointer;
771
+ white-space: nowrap;
772
+ color: $link-color;
773
+ background-color: rgba($link-color, 0.05);
774
+ border-radius: $border-radius;
775
+ padding: 0.1rem 0.25rem;
776
+
777
+ &:hover {
778
+ text-decoration: none !important;
779
+ color: $primary;
780
+ }
781
+ }
782
+
783
+ .popover-tool {
784
+ max-width: 20rem;
785
+
786
+ h5 {
787
+ font-weight: bold;
788
+ }
789
+ }
790
+
672
791
  /*-----Hoover classes-----*/
673
792
 
674
793
  .hover-primary:hover,
data/assets/js/main.js CHANGED
@@ -31,7 +31,7 @@ $(document).ready(function () {
31
31
  */
32
32
  $(document).ready(function () {
33
33
  // Initialize navgoco with default options
34
- $("#side-nav>ul").navgoco({
34
+ $("#sidebar>nav>ul").navgoco({
35
35
  caretHtml: '',
36
36
  accordion: true,
37
37
  openClass: 'active', // open
@@ -163,3 +163,14 @@ $(function () {
163
163
  })
164
164
  })
165
165
  })
166
+
167
+ /**
168
+ * Activate popovers
169
+ */
170
+
171
+ $(function () {
172
+ var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
173
+ var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
174
+ return new bootstrap.Popover(popoverTriggerEl)
175
+ })
176
+ })
data/assets/js/toc.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // https://github.com/ghiculescu/jekyll-table-of-contents
2
- (function($){
3
- $.fn.toc = function(options) {
2
+ (function ($) {
3
+ $.fn.toc = function (options) {
4
4
  var defaults = {
5
5
  noBackToTopLinks: false,
6
6
  title: '<i>Jump to...</i>',
@@ -9,36 +9,39 @@
9
9
  listType: 'ol', // values: [ol|ul]
10
10
  showEffect: 'show', // values: [show|slideDown|fadeIn|none]
11
11
  showSpeed: 'slow', // set to 0 to deactivate effect
12
- classes: { list: '',
13
- item: '',
14
- link: '',
15
- toc: ''
16
- }
12
+ classes: {
13
+ list: '',
14
+ item: '',
15
+ link: '',
16
+ toc: ''
17
+ }
17
18
  },
18
- settings = $.extend(defaults, options);
19
+ settings = $.extend(defaults, options);
19
20
 
20
- function fixedEncodeURIComponent (str) {
21
- return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
21
+ function fixedEncodeURIComponent(str) {
22
+ return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
22
23
  return '%' + c.charCodeAt(0).toString(16);
23
24
  });
24
25
  }
25
26
 
26
- function createLink (header) {
27
+ function createLink(header) {
27
28
  var innerText = (header.textContent === undefined) ? header.innerText : header.textContent;
28
- return "<a class='"+settings.classes.link+"' href='#" + fixedEncodeURIComponent(header.id) + "'>" + innerText + "</a>";
29
+ return "<a class='" + settings.classes.link + "' href='#" + fixedEncodeURIComponent(header.id) + "'>" + innerText + "</a>";
29
30
  }
30
31
 
31
- var headers = $(settings.headers).filter(function() {
32
+ var headers = $(settings.headers).filter(function () {
32
33
  // get all headers with an ID
33
- var previousSiblingName = $(this).prev().attr( "name" );
34
+ var previousSiblingName = $(this).prev().attr("name");
34
35
  if (!this.id && previousSiblingName) {
35
- this.id = $(this).attr( "id", previousSiblingName.replace(/\./g, "-") );
36
+ this.id = $(this).attr("id", previousSiblingName.replace(/\./g, "-"));
36
37
  }
37
38
  return this.id;
38
39
  }), output = $(this);
39
40
  if (!headers.length || headers.length < settings.minimumHeaders || !output.length) {
40
- $(this).hide();
41
41
  return;
42
+ } else {
43
+ $('#main').addClass("add-grid");
44
+ $("#toc").show();
42
45
  }
43
46
 
44
47
  if (0 === settings.showSpeed) {
@@ -48,50 +51,50 @@
48
51
  $(this).addClass(settings.classes.toc)
49
52
 
50
53
  var render = {
51
- show: function() { output.hide().html(html).show(settings.showSpeed); },
52
- slideDown: function() { output.hide().html(html).slideDown(settings.showSpeed); },
53
- fadeIn: function() { output.hide().html(html).fadeIn(settings.showSpeed); },
54
- none: function() { output.html(html); }
54
+ show: function () { output.hide().html(html).show(settings.showSpeed); },
55
+ slideDown: function () { output.hide().html(html).slideDown(settings.showSpeed); },
56
+ fadeIn: function () { output.hide().html(html).fadeIn(settings.showSpeed); },
57
+ none: function () { output.html(html); }
55
58
  };
56
59
 
57
- var get_level = function(ele) { return parseInt(ele.nodeName.replace("H", ""), 10); };
58
- var highest_level = headers.map(function(_, ele) { return get_level(ele); }).get().sort()[0];
60
+ var get_level = function (ele) { return parseInt(ele.nodeName.replace("H", ""), 10); };
61
+ var highest_level = headers.map(function (_, ele) { return get_level(ele); }).get().sort()[0];
59
62
  var return_to_top = '<i class="icon-arrow-up back-to-top"> </i>';
60
63
 
61
64
  var level = get_level(headers[0]),
62
65
  this_level,
63
- html = settings.title + " <" +settings.listType + " class=\"" + settings.classes.list +"\">";
64
- headers.on('click', function() {
66
+ html = settings.title + " <" + settings.listType + " class=\"" + settings.classes.list + "\">";
67
+ headers.on('click', function () {
65
68
  if (!settings.noBackToTopLinks) {
66
69
  window.location.hash = this.id;
67
70
  }
68
71
  })
69
- .addClass('clickable-header')
70
- .each(function(_, header) {
71
- this_level = get_level(header);
72
- if (!settings.noBackToTopLinks && this_level === highest_level) {
73
- $(header).addClass('top-level-header').after(return_to_top);
74
- }
75
- if (this_level === level) // same level as before; same indenting
76
- html += "<li class=\"" + settings.classes.item + "\">" + createLink(header);
77
- else if (this_level <= level){ // higher level than before; end parent ol
78
- for(var i = this_level; i < level; i++) {
79
- html += "</li></"+settings.listType+">"
72
+ .addClass('clickable-header')
73
+ .each(function (_, header) {
74
+ this_level = get_level(header);
75
+ if (!settings.noBackToTopLinks && this_level === highest_level) {
76
+ $(header).addClass('top-level-header').after(return_to_top);
80
77
  }
81
- html += "<li class=\"" + settings.classes.item + "\">" + createLink(header);
82
- }
83
- else if (this_level > level) { // lower level than before; expand the previous to contain a ol
84
- for(i = this_level; i > level; i--) {
85
- html += "<" + settings.listType + " class=\"" + settings.classes.list +"\">" +
86
- "<li class=\"" + settings.classes.item + "\">"
78
+ if (this_level === level) // same level as before; same indenting
79
+ html += "<li class=\"" + settings.classes.item + "\">" + createLink(header);
80
+ else if (this_level <= level) { // higher level than before; end parent ol
81
+ for (var i = this_level; i < level; i++) {
82
+ html += "</li></" + settings.listType + ">"
83
+ }
84
+ html += "<li class=\"" + settings.classes.item + "\">" + createLink(header);
87
85
  }
88
- html += createLink(header);
89
- }
90
- level = this_level; // update for the next one
91
- });
92
- html += "</"+settings.listType+">";
86
+ else if (this_level > level) { // lower level than before; expand the previous to contain a ol
87
+ for (i = this_level; i > level; i--) {
88
+ html += "<" + settings.listType + " class=\"" + settings.classes.list + "\">" +
89
+ "<li class=\"" + settings.classes.item + "\">"
90
+ }
91
+ html += createLink(header);
92
+ }
93
+ level = this_level; // update for the next one
94
+ });
95
+ html += "</" + settings.listType + ">";
93
96
  if (!settings.noBackToTopLinks) {
94
- $(document).on('click', '.back-to-top', function() {
97
+ $(document).on('click', '.back-to-top', function () {
95
98
  $(window).scrollTop(0);
96
99
  window.location.hash = '';
97
100
  });