Fixed issue with JS vs. YAML content location, and link styling
This commit is contained in:
@@ -534,10 +534,20 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
console.error('Cannot apply template: template is null or undefined');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
console.log('Applying template:', selectedTemplate.title);
|
||||
console.log('Template data structure:', selectedTemplate);
|
||||
|
||||
|
||||
// Clear all textareas before applying the new template
|
||||
// This ensures that fields from a previous template are not left behind
|
||||
document.querySelectorAll('textarea').forEach(textarea => {
|
||||
// Skip the protocol summary textarea as we'll set it separately
|
||||
if (textarea.id !== 'protocol-summary') {
|
||||
textarea.value = '';
|
||||
}
|
||||
});
|
||||
console.log('Cleared all field textareas before applying template');
|
||||
|
||||
// Reset protocol data while preserving metadata
|
||||
protocol = {
|
||||
metadata: {
|
||||
@@ -549,7 +559,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
templateTitle: selectedTemplate.title,
|
||||
templateDescription: selectedTemplate.description
|
||||
};
|
||||
|
||||
|
||||
// Always use the template description for summary when applying a template
|
||||
protocolSummaryTextarea.value = selectedTemplate.description;
|
||||
protocol.metadata.summary = selectedTemplate.description;
|
||||
|
||||
Reference in New Issue
Block a user