additionals/assets/javascripts/additionals.js
2019-10-03 18:17:55 +02:00

26 lines
638 B
JavaScript

/* exported openExternalLink */
function openExternalLink() {
var handleNewWindow = function() {
this.target = '_blank';
this.rel = 'noopener';
};
$('div.attachments a, a.external').each(handleNewWindow);
}
/* exported setClipboardJS */
/* global ClipboardJS */
function setClipboardJS(element){
var clipboard = new ClipboardJS(element);
clipboard.on('success', function(e) {
$(element).tooltip({
content: $(element).data('label-copied')
});
setTimeout(function() {
e.clearSelection();
$(element).tooltip({
content: $(element).data('label-to-copy')
});
}, 1000);
});
}