asciidoctor-html 2.2.8 → 2.2.9

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.
@@ -11,7 +11,7 @@ module Asciidoctor
11
11
  # The template for the book layout
12
12
  module BookTemplate
13
13
  MENU_BTN = <<~HTML
14
- <button type="button" id="menu-btn" class="btn menu"
14
+ <button type="button" id="menu-btn" class="btn menu fadein"
15
15
  aria-expanded="false" aria-controls="sidebar">
16
16
  <i class="bi bi-list"></i>
17
17
  </button>
@@ -148,6 +148,7 @@ module Asciidoctor
148
148
  // MathJax needs displayed content to calculate auto line breaks.
149
149
  await MathJax.startup.promise;
150
150
  await MathJax.typesetPromise(typesetEls);
151
+ ADHT.nudgeMenuBtn();
151
152
  page.classList.add('loaded');
152
153
 
153
154
  nav.forEach(el => {
@@ -173,7 +174,6 @@ module Asciidoctor
173
174
  focusOnLoad();
174
175
  if(isPresentation) focusEl.dataset.flip = id;
175
176
  currentId = id;
176
- ADHT.nudgeMenuBtn();
177
177
  }
178
178
 
179
179
  const dropdownItems = document.querySelectorAll('#viewmode-actions .dropdown-item');
@@ -41,8 +41,8 @@ module Asciidoctor
41
41
  def display_paginator(prv, nxt)
42
42
  blank = %(<span class="blank">&nbsp;</span>)
43
43
  html = [<<~HTML
44
- <div class="paginator-wrapper fadein">
45
- <div id="paginator" class="paginator dynamic-width">
44
+ <div class="paginator-wrapper">
45
+ <div id="paginator" class="paginator dynamic-width fadein">
46
46
  HTML
47
47
  ]
48
48
  html << if prv
@@ -9,19 +9,14 @@ module Asciidoctor
9
9
  const menuBtn = document.getElementById('menu-btn');
10
10
  if(!menuBtn) return;
11
11
 
12
- const isPresentation = page.classList.contains('presentation')
13
- if(isPresentation) {
14
- menuBtn.getAnimations().forEach(anim => anim.cancel());
15
- return menuBtn;
16
- }
17
-
18
12
  const scrollbarWidth = page.offsetWidth - page.clientWidth;
19
13
 
20
14
  // Nudge menuBtn in case there is a scrollbar
21
- menuBtn.animate(
22
- { transform: 'translateX(' + (-scrollbarWidth) + 'px)' },
23
- { fill: 'forwards', duration: 150 }
24
- );
15
+ menuBtn.style.right = (scrollbarWidth + 12) + 'px';
16
+
17
+ if(menuBtn.classList.contains('fadein')) {
18
+ setTimeout(() => menuBtn.classList.remove('fadein'), 600);
19
+ }
25
20
 
26
21
  // Cache scrollbar width
27
22
  ADHT.scrollbarWidth = scrollbarWidth;
@@ -43,7 +38,7 @@ module Asciidoctor
43
38
  addEventListener('resize', hideSidebar);
44
39
  dismissBtn && dismissBtn.addEventListener('click', hideSidebar);
45
40
 
46
- const menuBtn = ADHT.nudgeMenuBtn();
41
+ const menuBtn = document.getElementById('menu-btn');
47
42
  if(!menuBtn) return;
48
43
  // Add click listener to toggle sidebar
49
44
  menuBtn.addEventListener('click', function() {
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Asciidoctor
4
4
  module Html
5
- VERSION = "2.2.8"
5
+ VERSION = "2.2.9"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-html
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.8
4
+ version: 2.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ravi Rajani