Widget: DevGuidelines: Difference between revisions
From LINKS Community Center
Cschwentker (talk | contribs) No edit summary |
Cschwentker (talk | contribs) No edit summary |
||
Line 347: | Line 347: | ||
Promise.all([getGuidelines()]).then(data => { | Promise.all([getGuidelines()]).then(data => { | ||
const guidelines = data[0]; | const guidelines = data[0]; | ||
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]; | ||
// 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 10:28, 23 November 2022
Development version of the List of Guidelines.
Not ready for production!