Difference between revisions of "Widget:DevGuidelines"

From LINKS Community Center
Jump to: navigation, search
Line 347: Line 347:
 
         Promise.all([getGuidelines()]).then(data => {
 
         Promise.all([getGuidelines()]).then(data => {
 
             const guidelines = data[0];
 
             const guidelines = data[0];
            console.log(guidelines);
 
  
 
             let COVERS_THEMATIC_VALUES =  []
 
             let COVERS_THEMATIC_VALUES =  []
Line 476: Line 475:
 
                 const summary = document.getElementById('filter-summary');
 
                 const summary = document.getElementById('filter-summary');
 
                 const filter = filters[0];
 
                 const filter = filters[0];
 
                console.log(filter);
 
 
                      
 
                      
 
                 // Set result counter
 
                 // Set result counter
Line 560: Line 557:
 
                 ) { filterPane.classList.remove('open'); }
 
                 ) { filterPane.classList.remove('open'); }
 
             }, { passive: true });
 
             }, { passive: true });
 +
 +
              // Fix bug where the table is truncated to zero height despite having visible rows.
 +
              tabulator.on('renderComplete', function() {
 +
                // TODO: Check the bugfix for a possible infinite event loop.
 +
                // This will help detect it, in case it happens.
 +
                console.log('Table height bugfix: render complete.');
 +
               
 +
                try {
 +
                    const holderHeight = tabulator.rowManager.element.offsetHeight;
 +
                    const tableHeight = tabulator.rowManager.tableElement.offsetHeight;
 +
                    if (
 +
                        holderHeight < tableHeight ||                          // table is truncated vertically (including zero-height)
 +
                        holderHeight - tableHeight > window.screen.availHeight  // table is more than a screen longer than content
 +
                    ) {
 +
                        tabulator.redraw();
 +
                    }
 +
                } catch (ignore) { }
 +
            });
 +
            // End bugfix
 
         });
 
         });
  

Revision as of 11:28, 23 November 2022

Development version of the List of Guidelines.
Not ready for production!