aboutsummaryrefslogtreecommitdiff
path: root/uploader/templates/phenotypes
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/templates/phenotypes')
-rw-r--r--uploader/templates/phenotypes/add-phenotypes-raw-files.html26
1 files changed, 13 insertions, 13 deletions
diff --git a/uploader/templates/phenotypes/add-phenotypes-raw-files.html b/uploader/templates/phenotypes/add-phenotypes-raw-files.html
index 3eb042e..8a7463a 100644
--- a/uploader/templates/phenotypes/add-phenotypes-raw-files.html
+++ b/uploader/templates/phenotypes/add-phenotypes-raw-files.html
@@ -400,6 +400,16 @@
}
};
+ var makePreviewUpdater = (preview_table) => {
+ return (data) => {
+ update_preview(
+ preview_table,
+ data,
+ filesMetadata(),
+ PREVIEW_ROWS);
+ };
+ };
+
var preview_tables_to_elements_map = {
"#tbl-preview-pheno-desc": "#finput-phenotype-descriptions",
"#tbl-preview-pheno-data": "#finput-phenotype-data",
@@ -426,12 +436,7 @@
readFirstNLines(
file_input[0].files[0],
10,
- [(data) => {
- update_preview(
- $(mapentry[0]),
- data,
- files_metadata(),
- PREVIEW_ROWS);}]);
+ [makePreviewUpdater(preview_table)]);
}
});
};
@@ -454,13 +459,8 @@
readFirstNLines(
event.target.files[0],
10,
- [(data) => {
- update_preview(
- $("#" + event.target.getAttribute("data-preview-table")),
- data,
- files_metadata(),
- PREVIEW_ROWS);
- }]);
+ [makePreviewUpdater(
+ $("#" + event.target.getAttribute("data-preview-table")))]);
});
});