Skip to content

Commit

Permalink
Fix code output
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMBarr committed Aug 3, 2023
1 parent fc8aeba commit 6c220d4
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ $(() => {
$('#btn-get-code').on('click', openDialog);

//All the 'copy' buttons
$('.btn-copy').on('click', (btn) => {
const tgtSelector = $(btn).data('target');
$('.btn-copy').on('click', (event) => {
const tgtSelector = $(event.target).data('target');
if (tgtSelector) {
console.log($(tgtSelector).val());
navigator.clipboard.writeText($(tgtSelector).val()).then(
() => {},
() => {
Expand Down Expand Up @@ -59,11 +60,23 @@ $(() => {
.join('\n');

$ctrlCodeHtml.val(
`<svg xmlns="${svgNs}" class="hidden-svg">
${prettyIndentHtml($svgFilter.get(0).outerHTML)}</svg>`
`<svg xmlns="${svgNs}" class="hidden-svg">${prettyIndentHtml(
'\n' + $svgFilter.get(0).outerHTML
)}</svg>`
);

$ctrlCodeCss.val(`.bg-texture {
position: relative;
}
.bg-texture::after {
content: '';
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 100%;
z-index: -1;
${textureStylesStr}
}
.hidden-svg {
Expand Down

0 comments on commit 6c220d4

Please sign in to comment.