Skip to content

Commit a948d29

Browse files
committed
MicroModal global settings
1 parent 156fe39 commit a948d29

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

hoverxref/_static/js/hoverxref.js_t

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,12 @@ $(document).ready(function() {
161161
$('#micromodal-title').html(a);
162162
$('#micromodal-content').html(content);
163163
MicroModal.show('micromodal', {
164-
disableScroll: false,
164+
openClass: '{{ hoverxref_modal_openclass }}',
165+
disableScroll: {{ 'true' if hoverxref_modal_disable_scroll else 'false' }},
166+
disableFocus: {{ 'true' if hoverxref_modal_disable_focus else 'false' }},
167+
awaitOpenAnimation: {{ 'true' if hoverxref_modal_awaitopenanimation else 'false' }},
168+
awaitCloseAnimation: {{ 'true' if hoverxref_modal_awaitcloseanimation else 'false' }},
169+
debugMode: {{ 'true' if hoverxref_modal_debugmode else 'false' }}
165170
});
166171
$('#micromodal .modal__container').scrollTop(0);
167172
reLoadSphinxTabs();

hoverxref/extension.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def setup(app):
109109
app.add_config_value('hoverxref_roles', [], 'env')
110110
app.add_config_value('hoverxref_domains', [], 'env')
111111

112+
# Tooltipster settings
112113
app.add_config_value('hoverxref_tooltip', False, 'env')
113114
app.add_config_value('hoverxref_tooltip_api_host', 'https://readthedocs.org', 'env')
114115
app.add_config_value('hoverxref_tooltip_theme', ['tooltipster-shadow', 'tooltipster-shadow-custom'], 'env')
@@ -120,14 +121,19 @@ def setup(app):
120121
app.add_config_value('hoverxref_tooltip_content', 'Loading...', 'env')
121122
app.add_config_value('hoverxref_tooltip_class', 'rst-content', 'env')
122123

123-
124+
# MicroModal settings
124125
app.add_config_value('hoverxref_modal', False, 'env')
125126
app.add_config_value('hoverxref_modal_hover_delay', 350, 'env')
126127
app.add_config_value('hoverxref_modal_class', 'rst-content', 'env')
128+
app.add_config_value('hoverxref_modal_openclass', 'is-open', 'env')
129+
app.add_config_value('hoverxref_modal_disable_focus', True, 'env')
130+
app.add_config_value('hoverxref_modal_disable_scroll', False, 'env')
131+
app.add_config_value('hoverxref_modal_awaitopenanimation', False, 'env')
132+
app.add_config_value('hoverxref_modal_awaitcloseanimation', False, 'env')
133+
app.add_config_value('hoverxref_modal_debugmode', False, 'env')
127134
app.add_config_value('hoverxref_modal_default_title', 'Note', 'env')
128135
app.add_config_value('hoverxref_modal_prefix_title', '📝 ', 'env')
129136

130-
131137
app.set_translator('html', HoverXRefHTMLTranslator, override=True)
132138

133139
# Read the Docs use ``readthedocs`` as the name of the build, so we need to

0 commit comments

Comments
 (0)