removing
This commit is contained in:
@@ -1,47 +1,21 @@
|
|||||||
class PrrByKeyTableView {
|
class PrrByKeyTableView {
|
||||||
|
|
||||||
#prrByKeyTable;
|
#prrByKeyTable;
|
||||||
#downloadPrrByKeyTableButton;
|
|
||||||
#text;
|
|
||||||
#valueName;
|
|
||||||
#prrByKeyProvider;
|
#prrByKeyProvider;
|
||||||
|
|
||||||
|
// FK-TODO: remove downloadPrrByKeyTableButton and valueName
|
||||||
constructor(prrByKeyTable, downloadPrrByKeyTableButton, valueName, prrByKeyProvider) {
|
constructor(prrByKeyTable, downloadPrrByKeyTableButton, valueName, prrByKeyProvider) {
|
||||||
this.#prrByKeyTable = prrByKeyTable;
|
this.#prrByKeyTable = prrByKeyTable;
|
||||||
this.#prrByKeyTable.initialize();
|
this.#prrByKeyTable.initialize();
|
||||||
this.#initializeButton(downloadPrrByKeyTableButton);
|
|
||||||
this.#valueName = valueName;
|
|
||||||
this.#prrByKeyProvider = prrByKeyProvider;
|
this.#prrByKeyProvider = prrByKeyProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
displayPrrByKeyTable4Value(id, text) {
|
displayPrrByKeyTable4Value(id, text) {
|
||||||
UIUtils.disableButton(this.#downloadPrrByKeyTableButton);
|
|
||||||
this.#prrByKeyProvider(id)
|
this.#prrByKeyProvider(id)
|
||||||
.then(prrByKey => {
|
.then(prrByKey => this.#prrByKeyTable.display(prrByKey));
|
||||||
this.#text = text;
|
|
||||||
this.#prrByKeyTable.display(prrByKey);
|
|
||||||
UIUtils.enableButton(this.#downloadPrrByKeyTableButton);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getTable() {
|
getTable() {
|
||||||
return this.#prrByKeyTable.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%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FK-TODO: remove this class: */
|
||||||
.downloadButton {
|
.downloadButton {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
display: none;
|
display: none;
|
||||||
|
|||||||
Reference in New Issue
Block a user