mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-23 23:21:00 +01:00
Fixed improved tooltips mounted when disabled
This commit is contained in:
parent
12a8e82837
commit
845fc610b0
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -249,7 +249,7 @@
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script src="{{ 'assets/javascripts/bundle.ad660dcc.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/bundle.fe8b6f2b.min.js' | url }}"></script>
|
||||
{% for script in config.extra_javascript %}
|
||||
{{ script | script_tag }}
|
||||
{% endfor %}
|
||||
|
@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
EMPTY,
|
||||
Observable,
|
||||
filter,
|
||||
finalize,
|
||||
@ -32,6 +33,7 @@ import {
|
||||
takeUntil
|
||||
} from "rxjs"
|
||||
|
||||
import { feature } from "~/_"
|
||||
import {
|
||||
Viewport,
|
||||
getElements,
|
||||
@ -85,6 +87,10 @@ export function patchEllipsis(
|
||||
const host = el.closest("a") || el
|
||||
host.title = text
|
||||
|
||||
// Do not mount improved tooltip if feature is disabled
|
||||
if (!feature("content.tooltips"))
|
||||
return EMPTY
|
||||
|
||||
/* Mount tooltip */
|
||||
return mountInlineTooltip2(host, { viewport$ })
|
||||
.pipe(
|
||||
@ -96,10 +102,11 @@ export function patchEllipsis(
|
||||
.subscribe()
|
||||
|
||||
// @todo move this outside of here and fix memleaks
|
||||
document$
|
||||
.pipe(
|
||||
switchMap(() => getElements(".md-status")),
|
||||
mergeMap(el => mountInlineTooltip2(el, { viewport$ }))
|
||||
)
|
||||
.subscribe()
|
||||
if (feature("content.tooltips"))
|
||||
document$
|
||||
.pipe(
|
||||
switchMap(() => getElements(".md-status")),
|
||||
mergeMap(el => mountInlineTooltip2(el, { viewport$ }))
|
||||
)
|
||||
.subscribe()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user