upgraded dependencies
This commit is contained in:
@@ -30,6 +30,15 @@ if (typeof Sfjs === 'undefined') {
|
||||
};
|
||||
}
|
||||
|
||||
if (navigator.clipboard) {
|
||||
document.querySelectorAll('[data-clipboard-text]').forEach(function(element) {
|
||||
removeClass(element, 'hidden');
|
||||
element.addEventListener('click', function() {
|
||||
navigator.clipboard.writeText(element.getAttribute('data-clipboard-text'));
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
addEventListener: addEventListener,
|
||||
|
||||
@@ -166,6 +175,14 @@ if (typeof Sfjs === 'undefined') {
|
||||
});
|
||||
}
|
||||
|
||||
/* Prevents from disallowing clicks on "copy to clipboard" elements inside toggles */
|
||||
var copyToClipboardElements = toggles[i].querySelectorAll('span[data-clipboard-text]');
|
||||
for (var k = 0; k < copyToClipboardElements.length; k++) {
|
||||
addEventListener(copyToClipboardElements[k], 'click', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
}
|
||||
|
||||
toggles[i].setAttribute('data-processed', 'true');
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user