1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 21:53:26 +00:00

Improve the UX of clipboard button

This commit is contained in:
Cotes Chung
2021-09-22 22:21:33 +08:00
parent abb548fcee
commit 1bb54096f4
5 changed files with 14 additions and 9 deletions

View File

@@ -41,7 +41,7 @@ $(function() {
});
$(btnSelector).tooltip({
trigger: 'click',
trigger: 'hover',
placement: 'left'
});
@@ -53,11 +53,12 @@ $(function() {
const ICON_DEFAULT = getIcon(btnSelector);
function showTooltip(btn) {
$(btn).tooltip('show');
const succeedTitle = $(btn).attr('title-succeed');
$(btn).attr('data-original-title', succeedTitle).tooltip('show');
}
function hideTooltip(btn) {
$(btn).tooltip('hide');
$(btn).tooltip('hide').removeAttr('data-original-title');
}
function setSuccessIcon(btn) {