clipboard: fix tooltip position for block code #175

This commit is contained in:
Sören Weber 2022-02-17 19:23:50 +01:00
parent 9f7308ca4c
commit fb9f06d98e
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589

View file

@ -347,12 +347,12 @@ jQuery(function() {
clip.on('success', function(e) {
e.clearSelection();
var inPre = $(e.trigger).parent().prop('tagName') == 'PRE';
var inPre = $(e.trigger).parent().parent().prop('tagName') == 'PRE';
$(e.trigger).attr('aria-label', 'Copied to clipboard!').addClass('tooltipped tooltipped-' + (inPre ? 'w' : 's'));
});
clip.on('error', function(e) {
var inPre = $(e.trigger).parent().prop('tagName') == 'PRE';
var inPre = $(e.trigger).parent().parent().prop('tagName') == 'PRE';
$(e.trigger).attr('aria-label', fallbackMessage(e.action)).addClass('tooltipped tooltipped-' + (inPre ? 'w' : 's'));
$(document).one('copy', function(){
$(e.trigger).attr('aria-label', 'Copied to clipboard!').addClass('tooltipped tooltipped-' + (inPre ? 'w' : 's'));