Skip to content

Commit

Permalink
Normalize whitespace and fix spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
psvenk committed Mar 17, 2021
1 parent 610e377 commit 439c941
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions public/js/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -603,15 +603,15 @@ let assignmentsTable = new Tabulator("#assignmentsTable", {
width: 40,
align: "center",
cellClick: function(e, cell) {

const data = cell.getRow().getData();
replaceAssignmentFromID(data, {assignment_id: data["assignment_id"], placeholder: true}, selected_class_i);


const undoSnackbar = new Snackbar(`You deleted ${data["name"]}`, {
color: "var(--red1)",
textColor: "var(--white)",
buttonText: "Undo",
buttonText: "Undo",
//buttonclick replaces the assignment with a placeholder that just contains the assignemnt ID
buttonClick: () => {
//gets index for splicing and comparing
Expand Down
12 changes: 6 additions & 6 deletions public/js/snackbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Snackbar {

/**
* snackbars contains key value pairs of snackbar IDs and snackbar references respectively
* snackbars contains key value pairs of snackbar IDs and snackbar references respectively
* if you ever need to get a snackbar from an ID
* snackbarIDs makes sure the IDs are unique
*/
Expand All @@ -17,7 +17,7 @@ class Snackbar {
/**
* state IDs
* DESTROYED means it doesn't exist in html
* HIDDEN means it exists but is hdiden
* HIDDEN means it exists but is hidden
* SHOWN means it exists and is shown
*/
static DESTROYED = 0
Expand All @@ -33,7 +33,7 @@ class Snackbar {
* destroyWhenButtonClicked : Boolean - Whether or not it should destroy itself when the button is clicked, defaults to true
* bodyClick: Function - Sets the body's onclick logic
* destroyWhenBodyClicked : Boolean - Whether or not it should destroy itself when the body is clicked, defaults to true
* timeout: Int - Time in ms
* timeout: Int - Time in ms
* timeoutFunction: Function - What to run on timeout (doesn't run if hidden or destroyed)
* timeoutMode: can be "destroy", "hide", "none" or empty. Determines what to do on timeout, destroys by default
*/
Expand Down Expand Up @@ -181,7 +181,7 @@ class Snackbar {
this.timeoutInProgress = undefined; //resets the timeoutInProgress variable at the end of the timeout
}, this.timeout);
}

const removeHidden = () => {
this.state = Snackbar.SHOWN
this.element.classList.remove("hidden");
Expand All @@ -199,7 +199,7 @@ class Snackbar {
}
}

/**
/**
* hides the snackbar
* returns the snackbar object
*/
Expand Down Expand Up @@ -261,4 +261,4 @@ class Snackbar {

return id;
}
}
}

0 comments on commit 439c941

Please sign in to comment.