removing
This commit is contained in:
@@ -1,47 +1,21 @@
|
||||
class PrrByKeyTableView {
|
||||
|
||||
#prrByKeyTable;
|
||||
#downloadPrrByKeyTableButton;
|
||||
#text;
|
||||
#valueName;
|
||||
#prrByKeyProvider;
|
||||
|
||||
// FK-TODO: remove downloadPrrByKeyTableButton and valueName
|
||||
constructor(prrByKeyTable, downloadPrrByKeyTableButton, valueName, prrByKeyProvider) {
|
||||
this.#prrByKeyTable = prrByKeyTable;
|
||||
this.#prrByKeyTable.initialize();
|
||||
this.#initializeButton(downloadPrrByKeyTableButton);
|
||||
this.#valueName = valueName;
|
||||
this.#prrByKeyProvider = prrByKeyProvider;
|
||||
}
|
||||
|
||||
displayPrrByKeyTable4Value(id, text) {
|
||||
UIUtils.disableButton(this.#downloadPrrByKeyTableButton);
|
||||
this.#prrByKeyProvider(id)
|
||||
.then(prrByKey => {
|
||||
this.#text = text;
|
||||
this.#prrByKeyTable.display(prrByKey);
|
||||
UIUtils.enableButton(this.#downloadPrrByKeyTableButton);
|
||||
});
|
||||
.then(prrByKey => this.#prrByKeyTable.display(prrByKey));
|
||||
}
|
||||
|
||||
getTable() {
|
||||
return this.#prrByKeyTable.getTable();
|
||||
}
|
||||
|
||||
#initializeButton(downloadPrrByKeyTableButton) {
|
||||
this.#downloadPrrByKeyTableButton = downloadPrrByKeyTableButton;
|
||||
UIUtils.disableButton(downloadPrrByKeyTableButton);
|
||||
downloadPrrByKeyTableButton.addEventListener(
|
||||
'click',
|
||||
() => this.#downloadPrrByKey())
|
||||
}
|
||||
|
||||
#downloadPrrByKey() {
|
||||
UrlUtils.downloadUrlAsFilename(
|
||||
window.URL.createObjectURL(
|
||||
new Blob(
|
||||
[this.#prrByKeyTable.getDisplayedTableAsCsv(`# ${this.#valueName}: ${this.#text}`)],
|
||||
{ type: 'text/csv' })),
|
||||
this.#text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4932,6 +4932,7 @@ table.dataTable.display tbody tr.prrTooHigh {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* FK-TODO: remove this class: */
|
||||
.downloadButton {
|
||||
margin-top: 10px;
|
||||
display: none;
|
||||
|
||||
Reference in New Issue
Block a user