diff --git a/docs/BatchcodeCombinationSelection.js b/docs/BatchcodeCombinationSelection.js new file mode 100644 index 00000000000..5c18d995489 --- /dev/null +++ b/docs/BatchcodeCombinationSelection.js @@ -0,0 +1,30 @@ +class BatchcodeCombinationSelection { + + getSelectBatchcodeCombination({ histograms, onSelect }) { + const selectBatchcodeCombination = UIUtils.instantiateTemplate('template-selectBatchcodeCombination'); + const batchcodesSelect = selectBatchcodeCombination.querySelector('#batchcodesSelect'); + this.#addBatchcodeCombinationOptions(batchcodesSelect, histograms); + batchcodesSelect.addEventListener( + 'change', + event => { + const histoDescr = histograms[event.target.value]; + onSelect(histoDescr); + }); + return selectBatchcodeCombination; + } + + #addBatchcodeCombinationOptions(batchcodesSelect, histograms) { + this.#getBatchcodeCombinationOptions(histograms).forEach(option => batchcodesSelect.add(option)); + } + + #getBatchcodeCombinationOptions(histograms) { + return histograms.map(this.#getBatchcodeCombinationOption); + } + + #getBatchcodeCombinationOption(histoDescr, index) { + const option = document.createElement("option"); + option.text = histoDescr.batchcodes.join(', '); + option.value = index; + return option; + } +} \ No newline at end of file diff --git a/docs/HistogramView.js b/docs/HistogramView.js index 0e6f9dcea5a..628e29c5b07 100644 --- a/docs/HistogramView.js +++ b/docs/HistogramView.js @@ -92,34 +92,3 @@ class HistogramView { } } } - -class BatchcodeCombinationSelection { - - getSelectBatchcodeCombination({ histograms, onSelect }) { - const selectBatchcodeCombination = UIUtils.instantiateTemplate('template-selectBatchcodeCombination'); - const batchcodesSelect = selectBatchcodeCombination.querySelector('#batchcodesSelect'); - this.#addBatchcodeCombinationOptions(batchcodesSelect, histograms); - batchcodesSelect.addEventListener( - 'change', - event => { - const histoDescr = histograms[event.target.value]; - onSelect(histoDescr); - }); - return selectBatchcodeCombination; - } - - #addBatchcodeCombinationOptions(batchcodesSelect, histograms) { - this.#getBatchcodeCombinationOptions(histograms).forEach(option => batchcodesSelect.add(option)); - } - - #getBatchcodeCombinationOptions(histograms) { - return histograms.map(this.#getBatchcodeCombinationOption); - } - - #getBatchcodeCombinationOption(histoDescr, index) { - const option = document.createElement("option"); - option.text = histoDescr.batchcodes.join(', '); - option.value = index; - return option; - } -} \ No newline at end of file diff --git a/docs/batchCodeTable.html b/docs/batchCodeTable.html index 88f556a927a..f54600e5cc6 100644 --- a/docs/batchCodeTable.html +++ b/docs/batchCodeTable.html @@ -23,6 +23,7 @@ +