diff --git a/src/_includes/global/baselayout.njk b/src/_includes/global/baselayout.njk index b7b971a4..d614ebc1 100644 --- a/src/_includes/global/baselayout.njk +++ b/src/_includes/global/baselayout.njk @@ -39,6 +39,9 @@ {% if toc %} {% endif %} + {% if hasTooltips %} + + {% endif %} {% block pageTitle %}{{ title + " | " if title }}{{ sitemeta.siteName | safe }}{% endblock %} @@ -52,16 +55,5 @@ {{ content | safe }} </main> {% block footer %}{% include "global/footer.njk" %}{% endblock %} - {% if hasTooltips %} - <script src="/assets/js/tooltips.js"></script> - <script> - var selector = '[data-tooltip]'; - var els = document.querySelectorAll(selector); - - for ( var i = 0; i < els.length; i++ ) { - var dm = new ARIAtip( els[i] ); - } - </script> - {% endif %} </body> </html> \ No newline at end of file diff --git a/src/assets/js/tooltips.js b/src/assets/js/tooltips.js index e597045a..acba6d27 100644 --- a/src/assets/js/tooltips.js +++ b/src/assets/js/tooltips.js @@ -300,4 +300,11 @@ var util = { }; // ARIAtip w.ARIAtip = ARIAtip; -})( window, document ); \ No newline at end of file +})( window, document ); + +var selector = '[data-tooltip]'; +var els = document.querySelectorAll(selector); + +for ( var i = 0; i < els.length; i++ ) { + var dm = new ARIAtip( els[i] ); +} \ No newline at end of file