Files
cv-site/static/hyperscript/pdf-modal._hs
T

36 lines
1.0 KiB
Plaintext
Raw Normal View History

-- File: pdf-modal._hs
-- Purpose: PDF modal helper functions
-- Last Updated: 2025-11-30
-- ==============================================================================
-- PDF CARD SELECTION HANDLER
-- ==============================================================================
-- Handles selection of PDF format cards in the modal
-- Called from each card's click event
def selectPdfCard(card)
-- Get the modal container
set modal to #pdf-modal
if modal is null then exit end
-- Remove selected from all cards
set cards to modal.querySelectorAll('.pdf-option-card')
for c in cards
remove .selected from c
set c's @aria-checked to 'false'
end
-- Add selected to this card
add .selected to card
set card's @aria-checked to 'true'
-- Enable download button
set downloadBtn to modal.querySelector('.pdf-download-btn')
if downloadBtn is not null
remove @disabled from downloadBtn
end
-- Store selected format for download
set window.selectedPdfFormat to card's @data-cv-format
end