Widget: DCTList: Difference between revisions

From LINKS Community Center
Jump to: navigation, search
Eschmidt (talk | contribs)
No edit summary
Eschmidt (talk | contribs)
No edit summary
Line 304: Line 304:
         const filterState = {};
         const filterState = {};


         const allFunctions = Array.from(document.querySelectorAll('#functions-filter input[type="checkbox"]'));
         const functionOptions = Array.from(document.querySelectorAll('#functions-filter input[type="checkbox"]'));
         const selFun = allFunctions.filter(checkbox => checkbox.checked).map(checkbox => checkbox.value);
         const selectedFunctions = functionOptions.filter(checkbox => checkbox.checked).map(checkbox => checkbox.value);
        console.log('ALL', allFunctions)
        console.log('CHOSEN', selFun)


         const selectedFunctions = Array.from(document.querySelectorAll('#functions-filter input[type="checkbox"]:checked'))
         // If all checkboxes are checked, disable the filter.
            .map(checkbox => checkbox.value);
         filterState.functions = selectedFunctions.length === functionOptions.length ? undefined : selectedFunctions;
         filterState.functions = selectedFunctions;


         const selectedSources = Array.from(document.querySelectorAll('#data-source-filter input[type="checkbox"]:checked'))
         const selectedSources = Array.from(document.querySelectorAll('#data-source-filter input[type="checkbox"]:checked'))

Revision as of 15:55, 22 August 2022

Development verstion of the DCT List.
Not ready for production!