Skip to content

Commit

Permalink
great linting
Browse files Browse the repository at this point in the history
  • Loading branch information
recrwplay committed Dec 21, 2023
1 parent e67ac8f commit 678379d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/js/06-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ document.addEventListener('DOMContentLoaded', function () {

return input
}

var copyToClipboard = function (code, language) {
var textarea = document.createElement('textarea')
textarea.value = cleanCode(code, language)
Expand All @@ -82,14 +82,14 @@ document.addEventListener('DOMContentLoaded', function () {
}

// capture copy command
let copyThis = document.querySelectorAll("pre code")
const copyThis = document.querySelectorAll('pre code')
copyThis.forEach((code) => {
code.addEventListener("copy", (e) => {
const selection = document.getSelection();
e.clipboardData.setData("text/plain", cleanCallouts(selection.toString()))
code.addEventListener('copy', (e) => {
const selection = document.getSelection()
e.clipboardData.setData('text/plain', cleanCallouts(selection.toString()))
e.preventDefault()
});
});
})
})

function capitalizeFirstLetter (string) {
return string.charAt(0).toUpperCase() + string.slice(1)
Expand Down

0 comments on commit 678379d

Please sign in to comment.