diff options
author | Vincent <vichenzo-thebaud@hotmail.com> | 2024-02-04 21:03:05 +0100 |
---|---|---|
committer | Vincent <vichenzo-thebaud@hotmail.com> | 2024-02-04 21:03:05 +0100 |
commit | ddf831494205c123d5e50053d901bcc7ce216fff (patch) | |
tree | 0a961a9ad742e7792ecfd3590f3c702753cddf11 /src | |
parent | 07ce511ae612d52652ef3ab2bf16062cdd5ef131 (diff) | |
download | htmx-ddf831494205c123d5e50053d901bcc7ce216fff.tar.gz htmx-ddf831494205c123d5e50053d901bcc7ce216fff.zip |
Lint code
Diffstat (limited to 'src')
-rw-r--r-- | src/htmx.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/htmx.js b/src/htmx.js index 5f7ebdc8..75236897 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -291,7 +291,7 @@ var htmx = (function() { function duplicateScript(script) { const newScript = getDocument().createElement('script') - forEach(script.attributes, function (attr) { + forEach(script.attributes, function(attr) { newScript.setAttribute(attr.name, attr.value) }) newScript.textContent = script.textContent @@ -299,21 +299,21 @@ var htmx = (function() { if (htmx.config.inlineScriptNonce) { newScript.nonce = htmx.config.inlineScriptNonce } - return newScript; + return newScript } function isJavaScriptScriptNode(script) { - return script.matches('script') && (script.type === 'text/javascript' || script.type === 'module' || script.type === ''); + return script.matches('script') && (script.type === 'text/javascript' || script.type === 'module' || script.type === '') } // we have to make new copies of script tags that we are going to insert because // SOME browsers (not saying who, but it involves an element and an animal) don't // execute scripts created in <template> tags when they are inserted into the DOM -// and all the others do lmao + // and all the others do lmao function normalizeScriptTags(fragment) { Array.from(fragment.querySelectorAll('script')).forEach((script) => { if (isJavaScriptScriptNode(script)) { - const newScript = duplicateScript(script); + const newScript = duplicateScript(script) const parent = script.parentNode try { parent.insertBefore(newScript, script) @@ -1301,7 +1301,7 @@ var htmx = (function() { }) if (swapOptions.anchor) { - const anchorTarget = resolveTarget("#" + swapOptions.anchor) + const anchorTarget = resolveTarget('#' + swapOptions.anchor) if (anchorTarget) { anchorTarget.scrollIntoView({ block: 'start', behavior: 'auto' }) } @@ -1380,9 +1380,9 @@ var htmx = (function() { if (triggerEvent(document.body, 'htmx:addingHeadElement', { headElement: node }) !== false) { // make a copy of script nodes so they will execute properly if (isJavaScriptScriptNode(node)) { - node = duplicateScript(node); + node = duplicateScript(node) } - currentHead.appendChild(node); + currentHead.appendChild(node) } } |