|
|
@ -100,7 +100,7 @@ module.exports = class TestTab { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
self._deps.filePanel.event.register('newTestFileCreated', file => { |
|
|
|
self._deps.filePanel.event.register('newTestFileCreated', file => { |
|
|
|
var testList = document.querySelector("[class^='testList']") |
|
|
|
var testList = self.view.querySelector("[class^='testList']") |
|
|
|
var test = yo`<label class="singleTestLabel"><input class="singleTest" onchange=${(e) => toggleCheckbox(e.target.checked, file)} type="checkbox" checked="true">${file}</label>` |
|
|
|
var test = yo`<label class="singleTestLabel"><input class="singleTest" onchange=${(e) => toggleCheckbox(e.target.checked, file)} type="checkbox" checked="true">${file}</label>` |
|
|
|
testList.appendChild(test) |
|
|
|
testList.appendChild(test) |
|
|
|
self.data.allTests.push(file) |
|
|
|
self.data.allTests.push(file) |
|
|
@ -138,12 +138,12 @@ module.exports = class TestTab { |
|
|
|
|
|
|
|
|
|
|
|
function toggleCheckbox (eChecked, test) { |
|
|
|
function toggleCheckbox (eChecked, test) { |
|
|
|
if (!self.data.selectedTests) { |
|
|
|
if (!self.data.selectedTests) { |
|
|
|
self.data.selectedTests = document.querySelectorAll('.singleTest:checked') |
|
|
|
self.data.selectedTests = self._view.el.querySelectorAll('.singleTest:checked') |
|
|
|
} |
|
|
|
} |
|
|
|
let selectedTests = self.data.selectedTests |
|
|
|
let selectedTests = self.data.selectedTests |
|
|
|
selectedTests = eChecked ? [...selectedTests, test] : selectedTests.filter(el => el !== test) |
|
|
|
selectedTests = eChecked ? [...selectedTests, test] : selectedTests.filter(el => el !== test) |
|
|
|
self.data.selectedTests = selectedTests |
|
|
|
self.data.selectedTests = selectedTests |
|
|
|
let checkAll = document.querySelector('[id="checkAllTests"]') |
|
|
|
let checkAll = self._view.el.querySelector('[id="checkAllTests"]') |
|
|
|
if (eChecked) { |
|
|
|
if (eChecked) { |
|
|
|
checkAll.checked = true |
|
|
|
checkAll.checked = true |
|
|
|
} else if (!selectedTests.length) { |
|
|
|
} else if (!selectedTests.length) { |
|
|
@ -152,8 +152,8 @@ module.exports = class TestTab { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function checkAll (event) { |
|
|
|
function checkAll (event) { |
|
|
|
let checkBoxes = document.querySelectorAll('.singleTest') |
|
|
|
let checkBoxes = self._view.el.querySelectorAll('.singleTest') |
|
|
|
const checkboxesLabels = document.querySelectorAll('.singleTestLabel') |
|
|
|
const checkboxesLabels = self._view.el.querySelectorAll('.singleTestLabel') |
|
|
|
// checks/unchecks all
|
|
|
|
// checks/unchecks all
|
|
|
|
for (let i = 0; i < checkBoxes.length; i++) { |
|
|
|
for (let i = 0; i < checkBoxes.length; i++) { |
|
|
|
checkBoxes[i].checked = event.target.checked |
|
|
|
checkBoxes[i].checked = event.target.checked |
|
|
|