From 5788329e1ac14c6a82acfb4abb4b5fa6b7de68dc Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Tue, 17 Dec 2019 12:52:33 +0000 Subject: [PATCH] add ability to set css class to sortable tables. Make certificates table certificates class --- webui/src/main/js/certificates.js | 1 + webui/src/main/js/tables.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/webui/src/main/js/certificates.js b/webui/src/main/js/certificates.js index 7cc6836d..cd5d6c04 100644 --- a/webui/src/main/js/certificates.js +++ b/webui/src/main/js/certificates.js @@ -98,6 +98,7 @@ class CertificateResponse { else if (params.order == "ascending") newOrder = "descending" var table = new Table(["Issuer", "Name", "Timestamp", "Import"], "sort", params.key, newOrder, this.divId) + table.setCSSClass("certificates") var i for (i = 0; i < this.certificates.length; i++) { diff --git a/webui/src/main/js/tables.js b/webui/src/main/js/tables.js index d86e124e..1282bb63 100644 --- a/webui/src/main/js/tables.js +++ b/webui/src/main/js/tables.js @@ -39,14 +39,23 @@ class Table { this.rows = [] this.key = key this.descending = descending + this.cssClass = null } addRow(mapping) { this.rows.push(mapping) } + setCSSClass(cssClass) { + this.cssClass = cssClass + } + render() { - var html = "" + var html = "
" + if (this.cssClass != null) { + html = "
" + } + html += "" var i for (i = 0;i < this.columns.length; i++) { if (this.columns[i].key == this.key)