-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ability to set multiple columns, closes #5
- Loading branch information
Showing
5 changed files
with
156 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
datasette_enrichments_quickjs/templates/enrichment-quickjs.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{% extends "enrichment.html" %} | ||
|
||
{% block below_form %} | ||
<script> | ||
const modeSelect = document.querySelector('#mode'); | ||
const outputColumn = document.querySelector('#output_column').closest('.field'); | ||
const outputColumnLabel = document.querySelector('label[for=output_column]').closest('div'); | ||
const outputColumnType = document.querySelector('#output_column_type').closest('.field'); | ||
const outputColumnTypeLabel = document.querySelector('label[for=output_column_type]').closest('div'); | ||
function handleModeChange() { | ||
// If multi, hide those fields | ||
if (modeSelect.value === 'multi') { | ||
outputColumn.style.display = 'none'; | ||
outputColumnType.style.display = 'none'; | ||
outputColumnLabel.style.display = 'none'; | ||
outputColumnTypeLabel.style.display = 'none'; | ||
} else { | ||
outputColumn.style.display = ''; | ||
outputColumnType.style.display = ''; | ||
outputColumnLabel.style.display = ''; | ||
outputColumnTypeLabel.style.display = ''; | ||
} | ||
} | ||
modeSelect.addEventListener('change', handleModeChange); | ||
handleModeChange(); | ||
</script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters