mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-27 17:00:54 +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 %}
|
||||
</div>
|
||||
{% 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(",") %}
|
||||
{% if languages | length and languages[0] != "" %}
|
||||
{% 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")
|
||||
|
||||
/* Success handler */
|
||||
let timer = null
|
||||
copy.on("success", action => {
|
||||
const message = action.trigger.querySelector(".md-clipboard__message")
|
||||
if (!(message instanceof HTMLElement))
|
||||
@ -97,17 +96,18 @@ function initialize(config) { // eslint-disable-line func-style
|
||||
|
||||
/* Clear selection and reset debounce logic */
|
||||
action.clearSelection()
|
||||
if (timer)
|
||||
clearTimeout(timer)
|
||||
if (message.dataset.mdTimer)
|
||||
clearTimeout(parseInt(message.dataset.mdTimer, 10))
|
||||
|
||||
/* Set message indicating success and show it */
|
||||
message.classList.add("md-clipboard__message--active")
|
||||
message.innerHTML = "Copied to clipboard"
|
||||
|
||||
/* Hide message after two seconds */
|
||||
timer = setTimeout(() => {
|
||||
message.dataset.mdTimer = setTimeout(() => {
|
||||
message.classList.remove("md-clipboard__message--active")
|
||||
}, 2000)
|
||||
message.dataset.mdTimer = ""
|
||||
}, 2000).toString()
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user