Skip to content

Commit

Permalink
More javascript corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
york-stsci committed Aug 28, 2024
1 parent 552e788 commit 95227cd
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions jwql/website/apps/jwql/templates/log_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,32 +125,35 @@ <h4> {{ log_name|safe }} </h4><hr>
const folderInputField = document.getElementById('log_folder');
var logFoldersList = document.getElementById("log_folders");
folderInputField.addEventListener('input', function () {
if (logFoldersList.options.namedItem(this.value) === "all_logs") {
var currentFolder = logFoldersList.options.namedItem(this.value);
if (currentFolder === "all_logs") {
listOfLogNamesByFolder = {{ all_logs['all']|safe }};
} else {
listOfLogNamesByFolder = logsByFolder[this.value];
listOfLogNamesByFolder = logsByFolder[currentFolder];
}
setLogList();
});

const dateInputField = document.getElementById('log_date');
var logDatesList = document.getElementById("log_dates");
dateInputField.addEventListener('input', function () {
if (logDatesList.options.namedItem(this.value) === "all_logs") {
var currentDate = logDatesList.options.namedItem(this.value);
if (currentDate === "all_logs") {
listOfLogNamesBydate = {{ all_logs['all']|safe }};
} else {
listOfLogNamesBydate = logsByDate[this.value];
listOfLogNamesBydate = logsByDate[currentDate];
}
setLogList();
});

const levelInputField = document.getElementById('log_level');
var logLevelsList = document.getElementById('log_levels');
levelInputField.addEventListener('input', function () {
if (logLevelsList.options.namedItem(this.value) === "all_logs") {
var currentLevel = logLevelsList.options.namedItem(this.value);
if (currentLevel === "all_logs") {
listOfLogNamesByLevel = {{ all_logs['all']|safe }};
} else {
listOfLogNamesByLevel = logsByLevel[this.value];
listOfLogNamesByLevel = logsByLevel[currentLevel];
}
setLogList();
});
Expand Down

0 comments on commit 95227cd

Please sign in to comment.