golden hour
/home/godaofbq/elitehyperbarics.com/wp-content/plugins/code-snippets/js/manage
⬆️ Go Up
Upload
File/Folder
Size
Actions
activation.ts
2.22 KB
Del
OK
cloud.ts
1.44 KB
Del
OK
index.ts
261 B
Del
OK
priority.ts
734 B
Del
OK
requests.ts
1.68 KB
Del
OK
Edit: priority.ts
import { Snippet } from '../types/Snippet' import { updateSnippet } from './requests' /** * Update the priority of a snippet */ export const updateSnippetPriority = (element: HTMLInputElement) => { const row = element.parentElement?.parentElement const snippet: Partial<Snippet> = { priority: parseFloat(element.value) } if (row) { updateSnippet('priority', row, snippet) } else { console.error('Could not update snippet information.', snippet, row) } } export const handleSnippetPriorityChanges = () => { for (const field of document.getElementsByClassName('snippet-priority') as HTMLCollectionOf<HTMLInputElement>) { field.addEventListener('input', () => updateSnippetPriority(field)) field.disabled = false } }
Save