Further improvements for filter elements

This commit is contained in:
Oliver 2021-11-01 09:21:42 +11:00
parent 1f537a50b2
commit 80e741fe1b
2 changed files with 10 additions and 9 deletions

View File

@ -295,8 +295,6 @@
vertical-align: middle; vertical-align: middle;
margin: 1px; margin: 1px;
padding: 2px; padding: 2px;
background: #eee;
border: 1px solid #eee;
border-radius: 3px; border-radius: 3px;
} }
@ -322,8 +320,6 @@
zoom: 1; zoom: 1;
padding-left: 3px; padding-left: 3px;
padding-right: 3px; padding-right: 3px;
padding-top: 2px;
padding-bottom: 2px;
border: 1px solid #aaa; border: 1px solid #aaa;
border-radius: 3px; border-radius: 3px;
background: #eee; background: #eee;
@ -332,6 +328,12 @@
margin-right: 5px; margin-right: 5px;
} }
.filter-button {
padding: 2px;
padding-left: 4px;
padding-right: 4px;
}
.filter-input { .filter-input {
display: inline-block; display: inline-block;
*display: inline; *display: inline;

View File

@ -281,7 +281,7 @@ function setupFilterList(tableKey, table, target) {
// One blank slate, please // One blank slate, please
element.empty(); element.empty();
element.append(`<button id='reload-${tableKey}' title='{% trans "Reload data" %}' class='btn btn-outline-secondary filter-tag'><span class='fas fa-redo-alt'></span></button>`); element.append(`<button id='reload-${tableKey}' title='{% trans "Reload data" %}' class='btn btn-outline-secondary filter-button'><span class='fas fa-redo-alt'></span></button>`);
// Callback for reloading the table // Callback for reloading the table
element.find(`#reload-${tableKey}`).click(function() { element.find(`#reload-${tableKey}`).click(function() {
@ -293,11 +293,10 @@ function setupFilterList(tableKey, table, target) {
return; return;
} }
// If there are filters currently "in use", add them in! element.append(`<button id='${add}' title='{% trans "Add new filter" %}' class='btn btn-outline-secondary filter-button'><span class='fas fa-filter'></span></button>`);
element.append(`<button id='${add}' title='{% trans "Add new filter" %}' class='btn btn-outline-secondary filter-tag'><span class='fas fa-filter'></span></button>`);
if (Object.keys(filters).length > 0) { if (Object.keys(filters).length > 0) {
element.append(`<button id='${clear}' title='{% trans "Clear all filters" %}' class='btn btn-outline-secondary filter-tag'><span class='fas fa-backspace icon-red'></span></button>`); element.append(`<button id='${clear}' title='{% trans "Clear all filters" %}' class='btn btn-outline-secondary filter-button'><span class='fas fa-backspace icon-red'></span></button>`);
} }
for (var key in filters) { for (var key in filters) {
@ -320,7 +319,7 @@ function setupFilterList(tableKey, table, target) {
html += generateAvailableFilterList(tableKey); html += generateAvailableFilterList(tableKey);
html += generateFilterInput(tableKey); html += generateFilterInput(tableKey);
html += `<button title='{% trans "Create filter" %}' class='btn btn-outline-secondary filter-tag' id='${make}'><span class='fas fa-plus'></span></button>`; html += `<button title='{% trans "Create filter" %}' class='btn btn-outline-secondary filter-button' id='${make}'><span class='fas fa-plus'></span></button>`;
element.append(html); element.append(html);