mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-28 01:10:58 +01:00
Fixed non-disappearing tooltip
This commit is contained in:
parent
e5761ccfb1
commit
ba0b46e9b0
4
material/assets/javascripts/application-b30566c560.js
Normal file
4
material/assets/javascripts/application-b30566c560.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
material/assets/stylesheets/application-acc56dad49.css
Normal file
1
material/assets/stylesheets/application-acc56dad49.css
Normal file
File diff suppressed because one or more lines are too long
@ -149,7 +149,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ base_url }}/assets/javascripts/application-e3caa82af6.js"></script>
|
<script src="{{ base_url }}/assets/javascripts/application-b30566c560.js"></script>
|
||||||
{% set languages = lang.t("search.languages").split(",") %}
|
{% set languages = lang.t("search.languages").split(",") %}
|
||||||
{% if languages | length and languages[0] != "" %}
|
{% if languages | length and languages[0] != "" %}
|
||||||
{% set path = base_url + "/assets/javascripts/lunr" %}
|
{% set path = base_url + "/assets/javascripts/lunr" %}
|
||||||
|
@ -89,7 +89,6 @@ function initialize(config) { // eslint-disable-line func-style
|
|||||||
const copy = new Clipboard(".md-clipboard")
|
const copy = new Clipboard(".md-clipboard")
|
||||||
|
|
||||||
/* Success handler */
|
/* Success handler */
|
||||||
let timer = null
|
|
||||||
copy.on("success", action => {
|
copy.on("success", action => {
|
||||||
const message = action.trigger.querySelector(".md-clipboard__message")
|
const message = action.trigger.querySelector(".md-clipboard__message")
|
||||||
if (!(message instanceof HTMLElement))
|
if (!(message instanceof HTMLElement))
|
||||||
@ -97,17 +96,18 @@ function initialize(config) { // eslint-disable-line func-style
|
|||||||
|
|
||||||
/* Clear selection and reset debounce logic */
|
/* Clear selection and reset debounce logic */
|
||||||
action.clearSelection()
|
action.clearSelection()
|
||||||
if (timer)
|
if (message.dataset.mdTimer)
|
||||||
clearTimeout(timer)
|
clearTimeout(parseInt(message.dataset.mdTimer, 10))
|
||||||
|
|
||||||
/* Set message indicating success and show it */
|
/* Set message indicating success and show it */
|
||||||
message.classList.add("md-clipboard__message--active")
|
message.classList.add("md-clipboard__message--active")
|
||||||
message.innerHTML = "Copied to clipboard"
|
message.innerHTML = "Copied to clipboard"
|
||||||
|
|
||||||
/* Hide message after two seconds */
|
/* Hide message after two seconds */
|
||||||
timer = setTimeout(() => {
|
message.dataset.mdTimer = setTimeout(() => {
|
||||||
message.classList.remove("md-clipboard__message--active")
|
message.classList.remove("md-clipboard__message--active")
|
||||||
}, 2000)
|
message.dataset.mdTimer = ""
|
||||||
|
}, 2000).toString()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user