Difference between revisions of "Widget:DCTList"

From LINKS Community Center
Jump to: navigation, search
Line 646: Line 646:
 
                     tabulator.off('renderComplete', markImages);
 
                     tabulator.off('renderComplete', markImages);
 
                 }
 
                 }
                 tabulator.on('renderComplete', markImages);
+
                 tabulator.on('renderComplete', markImages); // TODO: Prevent this from running if corresponding filters are not active.
 
             });
 
             });
 
            // ------------------ TEST TEST -------------------------
 
            tabulator.on('renderComplete', function() {
 
                // console.log(tabulator);
 
                // tabulator.rowManager.displayRowsCount
 
                console.log('tableholder height:', tabulator.rowManager.element.offsetHeight);
 
                console.log('table height:', tabulator.rowManager.tableElement.offsetHeight);
 
            });
 
            // ------------------ TEST TEST -------------------------
 
  
 
             // Listen for changes in filter checkbox state.
 
             // Listen for changes in filter checkbox state.
Line 676: Line 667:
 
                 const wrapper = el.closest('.filter-wrapper');
 
                 const wrapper = el.closest('.filter-wrapper');
 
                 el.addEventListener('click', event => void wrapper.classList.toggle('open'));
 
                 el.addEventListener('click', event => void wrapper.classList.toggle('open'));
 +
            });
 +
 +
            // Fix bug where the table is truncated to zero height despite having visible rows
 +
            tabulator.on('renderComplete', function() {
 +
                console.log('render complete')
 +
                try {
 +
                    const holderHeight = tabulator.rowManager.element.offsetHeight;
 +
                    const tableHeight = tabulator.rowManager.tableElement.offsetHeight;
 +
                    if (holderHeight < tableHeight) { tabulator.redraw(); }
 +
                } catch (ignore) { }
 +
 +
                // tabulator.rowManager.displayRowsCount
 
             });
 
             });
 
         });
 
         });

Revision as of 15:21, 2 November 2022

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