Skip to content

Commit

Permalink
fix: remove even more PARAM_RAWs
Browse files Browse the repository at this point in the history
  • Loading branch information
jmorrph committed Jul 15, 2024
1 parent f78eb41 commit da01e74
Show file tree
Hide file tree
Showing 31 changed files with 74 additions and 68 deletions.
2 changes: 1 addition & 1 deletion amd/build/add_interaction.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion amd/build/learning_goals_functions.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion amd/build/learning_goals_functions.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion amd/build/planner_functions.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion amd/build/update_view.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amd/build/update_view.min.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions amd/src/add_interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ export const updateSetting = (updatetype, setting, val = undefined) => {
methodname: 'block_disealytics_write_user_preference',
args,
}
// eslint-disable-next-line no-unused-vars
])[0].done(async function(response) {
// Remove contents of the modal container.
await deleteModalsContainer();
Expand Down Expand Up @@ -458,7 +457,6 @@ export const enableViewmodeDropdown = () => {
let select = document.querySelector(".main-viewmode-selection");
const viewmodeLabel = document.querySelector(".main-viewmode-label");
if (viewmodeLabel) {
// viewmodeLabel.innerHTML = select.options[select.selectedIndex].innerHTML;
updateSetting("write", 'viewmode', select.value);
}
});
Expand Down
24 changes: 12 additions & 12 deletions amd/src/learning_goals_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,21 @@ export function initGoalEventListeners() {

// Show the create a goal form.
if (showGoalFormBtn) {
showGoalFormBtn.addEventListener('click', function () {
showGoalFormBtn.addEventListener('click', function() {
createGoalForm.classList.remove('hidden');
});
}

// Saving goal in database.
if (saveGoalBtn) {
saveGoalBtn.addEventListener('click', function () {
saveGoalBtn.addEventListener('click', function() {
saveGoal();
});
}

// Cancel/reset the create a goal form.
if (cancelGoalBtn) {
cancelGoalBtn.addEventListener('click', function () {
cancelGoalBtn.addEventListener('click', function() {
const goalNameInput = document.getElementById('goal-name-input');

// Reset the form.
Expand All @@ -102,7 +102,7 @@ export function initGoalEventListeners() {

// Delete a goal from the database.
for (const deleteGoalBtn of deleteGoalBtns) {
deleteGoalBtn.addEventListener('click', function () {
deleteGoalBtn.addEventListener('click', function() {
const goalId = deleteGoalBtn.parentNode.id;
deleteGoal(goalId);
});
Expand All @@ -112,7 +112,7 @@ export function initGoalEventListeners() {
if (editGoalsBtn) {
editGoalsBtn.addEventListener('click', () => {
// Set the color for the editing pencil on/off.
if(editGoalsBtn.querySelector('i').classList.contains('editing-off')) {
if (editGoalsBtn.querySelector('i').classList.contains('editing-off')) {
editGoalsBtn.querySelector('i').classList.remove('editing-off');
editGoalsBtn.querySelector('i').style.color = 'var(--diseared)';
} else {
Expand Down Expand Up @@ -288,10 +288,10 @@ async function saveGoal() {
goalname: goalNameInput,
duedate: timestamp,
}
}])[0].done(function () {
}])[0].done(function() {
// Resolve the promise when done.
resolve();
}).fail(function (err) {
}).fail(function(err) {
// Reject the promise if there's an error.
reject(err);
});
Expand Down Expand Up @@ -406,7 +406,7 @@ function editGoal(goalContent) {
if (validateInputs('update', updatedName, combinedDateTime, combinedDateTimeString, goalContent)) {
const updatedTimestamp = Number(combinedDateTime.getTime() / 1000);
await updateGoal(goalId, updatedName, updatedTimestamp, goalStatus).then(() => {
setEditingModeForLearningGoals();
return setEditingModeForLearningGoals();
});
}
});
Expand Down Expand Up @@ -436,10 +436,10 @@ async function updateGoal(id, name, date, finished) {
duedate: date,
finished: finished === true ? 1 : 0
}
}])[0].done(function () {
}])[0].done(function() {
updateView(getCourseId(), ['learning-goals-view']);
resolve(); // Resolve the promise when done
}).fail(function (err) {
}).fail(function(err) {
window.console.error(err);
reject(err); // Reject the promise if there's an error
});
Expand All @@ -461,12 +461,12 @@ function deleteGoal(id) {
args: {
goalid: id
}
}])[0].done(function () {
}])[0].done(function() {
// Update the view after successfully deleting the goal.
updateView(getCourseId(), ['learning-goals-view']);
// Resolve the promise when done.
resolve();
}).fail(function (err) {
}).fail(function(err) {
// Log the error to the console.
window.console.error(err);
// Reject the promise if there's an error.
Expand Down
Loading

0 comments on commit da01e74

Please sign in to comment.