Skip to content

Make task-lists-elements CSP Trusted Types compatible #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/task-lists-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,18 @@ export default class TaskListsElement extends HTMLElement {
}

const handleTemplate = document.createElement('template')
handleTemplate.innerHTML = `
<span class="handle">
<svg class="drag-handle" aria-hidden="true" width="16" height="16">
<path d="M10 13a1 1 0 100-2 1 1 0 000 2zm-4 0a1 1 0 100-2 1 1 0 000 2zm1-5a1 1 0 11-2 0 1 1 0 012 0zm3 1a1 1 0 100-2 1 1 0 000 2zm1-5a1 1 0 11-2 0 1 1 0 012 0zM6 5a1 1 0 100-2 1 1 0 000 2z"/>
</svg>
</span>`
const span = handleTemplate.content.appendChild(document.createElement('span'))
span.classList.add('handle')
const svg = span.appendChild(document.createElement('svg'))
svg.classList.add('drag-handle')
svg.setAttribute('aria-hidden', 'true')
svg.setAttribute('width', '16')
svg.setAttribute('height', '16')
const path = svg.appendChild(document.createElement('path'))
path.setAttribute(
'd',
'M10 13a1 1 0 100-2 1 1 0 000 2zm-4 0a1 1 0 100-2 1 1 0 000 2zm1-5a1 1 0 11-2 0 1 1 0 012 0zm3 1a1 1 0 100-2 1 1 0 000 2zm1-5a1 1 0 11-2 0 1 1 0 012 0zM6 5a1 1 0 100-2 1 1 0 000 2z'
)

const initialized = new WeakMap()

Expand Down