on master help sign in
Merge pull request #163 from matildepark/tooltip

Add support for tooltips in documentation

commitf87e4964e59cf1fdd309c10b58d07edd6881fa2f authorMorgan Sutherland <msutherl@users.noreply.github.com> dateThu 8 Aug 2019, 16:16 (7 years ago) parent3c13a0c032dcdc
4 files changed+19−2
content/docs+1−1 sass/_main.scss+4 static/scripts.js+12−1 templates/base.html+2
content/docs+1−1

Submodule changed.

sass/_main.scss+4
@@ -363,6 +363,10 @@ iframe {
363363 }
364364}
365365
366+.tippy-tooltip {
367+ border-radius: 0px;
368+}
369+
366370/*
367371 * styling
368372 */
static/scripts.js+12−1
@@ -340,4 +340,15 @@ let docsNavScroll = function() {
340340 }
341341}
342342
343−if (window.location.href.includes("docs")) docsNavScroll();
343+if (window.location.href.includes("docs")) {
344+ docsNavScroll();
345+ tippy('.tooltip', {
346+ content(reference) {
347+ const title = reference.getAttribute('title')
348+ reference.removeAttribute('title')
349+ return title
350+ },
351+ animateFill: false,
352+ animation: 'fade'
353+ })
354+}
templates/base.html+2
@@ -35,6 +35,8 @@
3535 {% if config.build_search_index %}
3636 <script type="text/javascript" src="{{ get_url(path="elasticlunr.min.js") | safe }}"></script>
3737 <script type="text/javascript" src="{{ get_url(path="search_index.en.js") | safe }}"></script>
38+ <script src="https://unpkg.com/popper.js@1"></script>
39+ <script src="https://unpkg.com/tippy.js@4"></script>
3840 {% endif %}
3941 <script src="{{ config.base_url }}/scripts.js"></script>
4042 </body>