Add description field to table filters

This commit is contained in:
Oliver Walters 2020-05-26 11:57:35 +10:00
parent 669a76c921
commit e63622341f

View File

@ -272,8 +272,9 @@ function setupFilterList(tableKey, table, target) {
for (var key in filters) {
var value = getFilterOptionValue(tableKey, key, filters[key]);
var title = getFilterTitle(tableKey, key);
var description = getFilterDescription(tableKey, key);
element.append(`<div class='filter-tag'>${title} = ${value}<span ${tag}='${key}' class='close'>x</span></div>`);
element.append(`<div title='${description}' class='filter-tag'>${title} = ${value}<span ${tag}='${key}' class='close'>x</span></div>`);
}
// Add a callback for adding a new filter
@ -362,6 +363,15 @@ function getFilterTitle(tableKey, filterKey) {
}
/**
* Return the pretty description for the given table and filter selection
*/
function getFilterDescription(tableKey, filterKey) {
var settings = getFilterSettings(tableKey, filterKey);
return settings.title;
}
/*
* Return a description for the given table and filter selection.
*/