Remove CSS handling from Table
Drop the loadCSS method and its constructor call. Styling is now the consumer's responsibility via the emitted class names, keeping the class self-contained and free of app-specific asset paths.
This commit is contained in:
@@ -38,8 +38,6 @@ export abstract class Table<TRow extends Object> {
|
|||||||
|
|
||||||
this.table.appendChild(this.tableBody);
|
this.table.appendChild(this.tableBody);
|
||||||
|
|
||||||
this.loadCSS()
|
|
||||||
|
|
||||||
this.messageEl = messageElement === undefined ? document.createElement("p") : messageElement;
|
this.messageEl = messageElement === undefined ? document.createElement("p") : messageElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,19 +81,6 @@ export abstract class Table<TRow extends Object> {
|
|||||||
this.table.appendChild(thead);
|
this.table.appendChild(thead);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Loads the CSS for tables into the html file for custom styling.
|
|
||||||
* @param relativePathAndName The path to go to for the cess file, including the filename and extension.
|
|
||||||
*/
|
|
||||||
loadCSS(relativePathAndName: string) {
|
|
||||||
const link = document.createElement("link");
|
|
||||||
link.rel = "stylesheet"
|
|
||||||
link.href = relativePathAndName;
|
|
||||||
link.type = 'text/css';
|
|
||||||
document.head.appendChild(link);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the table element of this instance for putting onto a page.
|
* Returns the table element of this instance for putting onto a page.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user