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 772: Line 772:
             if (encoded) {
             if (encoded) {
                 const action = JSON.parse(decodeURIComponent(atob(encoded)));
                 const action = JSON.parse(decodeURIComponent(atob(encoded)));
                 if (action.filter && action.filter.functions) {
 
                    Object.keys(action.filter.functions).forEach(fnCat => {
                const filter = action.filter;
                        console.log('func-filter-' + escapeAttr(fnCat))
                 if (filter) {
                        const fnBlock = document.getElementById('func-filter-' + escapeAttr(fnCat)).closest('.func-filter-block');
                    // Functions filter
                        fnBlock.querySelectorAll('input[type="checkbox"]').forEach(box => box.checked = action.filter.functions[fnCat]);
                    const functions = filter.functions;
                     });
                    if (functions) {
                        Object.keys(functions).forEach(fnCat => {
                            document.getElementById('func-filter-' + escapeAttr(fnCat))
                                .closest('.func-filter-block')
                                .querySelectorAll('input[type="checkbox"]').forEach(box => box.checked = functions[fnCat]);
                        });
                     }
 
                    // Further filters
                    // ...
 
                    applyFilters();
                 }
                 }
                // Further actions (e.g. open filter panel, etc.)
                // ...
             }
             }
         });
         });

Revision as of 14:26, 24 November 2022

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