Skip to content

Commit 9b9f3d5

Browse files
author
John M. Horan
committed
Add 'Package info' group button #91
* Also added CSS in main.css to slightly reduce buttons' left/right padding. Signed-off-by: John M. Horan <[email protected]>
1 parent a363f69 commit 9b9f3d5

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

assets/css/main.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,4 +366,15 @@ div.dataTables_scrollHead th:first-child {
366366
padding: 14px;
367367
text-align: center;
368368
color: #ffffff;
369+
}
370+
371+
/* Modify the colvis column-visibility and -grouping buttons */
372+
.buttons-colvis {
373+
padding-right: 10px;
374+
padding-left: 10px;
375+
}
376+
377+
.buttons-colvisGroup {
378+
padding-right: 10px;
379+
padding-left: 10px;
369380
}

assets/js/aboutCodeDataTables.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,24 @@ class AboutCodeDataTable {
245245
.map((column) => `${column.name}:name`)
246246
},
247247
{
248+
// Show only package columns
248249
extend: "colvisGroup",
249-
text: "Show all columns",
250+
text: "Package info",
251+
show: AboutCodeDataTable.PACKAGE_GROUP
252+
.map((column) => `${column.name}:name`),
253+
hide: AboutCodeDataTable.TABLE_COLUMNS
254+
.filter((column) => AboutCodeDataTable.PACKAGE_GROUP.indexOf(column) < 0)
255+
.map((column) => `${column.name}:name`)
256+
},
257+
{
258+
extend: "colvisGroup",
259+
text: "Show all",
250260
show: ":hidden"
251261
},
252262
{
253263
// Hide all columns except Path
254264
extend: "colvisGroup",
255-
text: "Hide all columns",
265+
text: "Hide all",
256266
show: AboutCodeDataTable.LOCATION_COLUMN
257267
.map((column) => `${column.name}:name`),
258268
hide: AboutCodeDataTable.TABLE_COLUMNS
@@ -298,6 +308,11 @@ class AboutCodeDataTable {
298308
return AboutCodeDataTable.LOCATION_COLUMN
299309
.concat(AboutCodeDataTable.ORIGIN_COLUMNS);
300310
}
311+
312+
static get PACKAGE_GROUP() {
313+
return AboutCodeDataTable.LOCATION_COLUMN
314+
.concat(AboutCodeDataTable.PACKAGE_COLUMNS);
315+
}
301316
}
302317

303318
AboutCodeDataTable.LOCATION_COLUMN =

0 commit comments

Comments
 (0)