Skip to content
This repository has been archived by the owner on Sep 4, 2022. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/js-test' into js-test
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperMartijn642 committed Jun 5, 2020
2 parents a4e3123 + e4d74fc commit 2abf12a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
17 changes: 8 additions & 9 deletions public/scripts/visualization/initiatesettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ let settingHelpMap = {
}

//- Update Dataset Dropdown with default value -//
let default_dataset = '';
updateDatasets()

//- Update Zoom Slider with default value -//
Expand All @@ -35,11 +34,11 @@ async function updateDatasets() {
let datasets = JSON.parse(data);

let values = [];
for (dataset of datasets) {
for (let dataset of datasets) {
let datasetValues = {};
datasetValues['name'] = dataset['name'];
datasetValues['value'] = "###" + dataset['id'];
datasetValues['selected'] = default_dataset === dataset['id'];
datasetValues['value'] = dataset['id'];
datasetValues['selected'] = datasetId === dataset['id'];
values.push(datasetValues);
}
$('.dropdown.search.selection.dataset')
Expand All @@ -48,26 +47,26 @@ async function updateDatasets() {
selectOnKeydown: false,
forceSelection: false,
fullTextSearch: 'exact',
minCharacters: 3,
//-minCharacters: 3,-// Causes a strange bug, just ignore this :)
match: 'both',
onChange: function(value) {
selectDataset(value);
}
});
});
});
}

//- Display Help Toast Per Setting -//
function settingHelp(setting) {
$('.toast')
$('.toast.settingHelp')
.toast('close')
$('body')
.toast({
showIcon: 'info',
title: setting + ' setting',
displayTime: 0,
displayTime: 5000,
message: settingHelpMap[setting],
class: 'info',
class: 'info settingHelp',
position: 'top center',
closeIcon: true
});
Expand Down
7 changes: 6 additions & 1 deletion public/scripts/visualization/readsettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ let zoomValue;

//- React on Dataset Selection Dropdown -//
function selectDataset(value) {
window.href = '/visualization?id=' + value.substring(3)
if (value !== "") {
if (value !== datasetId) {
//console.log('/visualization?id=' + value)
window.location.href = '/visualization?id=' + value;
}
}
}

function applySettings() {
Expand Down

0 comments on commit 2abf12a

Please sign in to comment.