Skip to content

Commit

Permalink
#24 reset view config & data on data table selection change
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomFractals committed Jun 12, 2019
1 parent b060fb1 commit 4f79ce0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions templates/data.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,9 @@
const dataFileType = saveFileTypeSelector.value;
switch (dataFileType) {
case '.config':
const dataFileName = dataUri.substr(dataUri.lastIndexOf('/') + 1);
const data = {
dataFileName: dataUri.substr(dataUri.lastIndexOf('/') + 1),
dataFileName: dataFileName,
dataTable: dataTable,
config: viewConfig
};
Expand Down Expand Up @@ -312,10 +313,15 @@
* Loads requested table data for data files with multiple data sets.
*/
function loadTableData() {
let dataTable = tableSelector.value;
if (!dataTable || dataTable === undefined) {
let tableName = tableSelector.value;
if (!tableName || tableName === undefined) {
// reset to empty for default data load
dataTable = '';
} else {
// reset view data table and config for new data load
dataTable = tableName;
viewConfig = {};
viewData = [];
}
reloadData(dataTable);
}
Expand Down

0 comments on commit 4f79ce0

Please sign in to comment.