Change pre code css in markdown
This commit is contained in:
parent
d75a498d18
commit
aef795b40c
24 changed files with 200 additions and 397 deletions
|
@ -21,34 +21,6 @@
|
|||
info_float.width(container.width());
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: remove this
|
||||
var copyButton;
|
||||
$('pre code').each(function () {
|
||||
$(this).parent().before($('<div>', {'class': 'copy-clipboard'})
|
||||
.append(copyButton = $('<span>', {
|
||||
'class': 'btn-clipboard',
|
||||
'data-clipboard-text': $(this).text(),
|
||||
'title': 'Click to copy'
|
||||
}).text('Copy')));
|
||||
|
||||
$(copyButton.get(0)).mouseleave(function () {
|
||||
$(this).attr('class', 'btn-clipboard');
|
||||
$(this).removeAttr('aria-label');
|
||||
});
|
||||
|
||||
var curClipboard = new Clipboard(copyButton.get(0));
|
||||
|
||||
curClipboard.on('success', function (e) {
|
||||
e.clearSelection();
|
||||
showTooltip(e.trigger, 'Copied!');
|
||||
});
|
||||
|
||||
curClipboard.on('error', function (e) {
|
||||
showTooltip(e.trigger, fallbackMessage(e.action));
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endcompress %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue