Skip to content

Commit

Permalink
tutorial updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mwilliams1188 committed Aug 5, 2020
1 parent a0eb8d6 commit d1edc94
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions client/tutorials.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,34 @@ function updateTutorial(id, object) {
// $('.cc-saved-counter').text(savedNum)
// $('.cc-completed-counter').text(completeNum)

$('.cc-save-item').click(() => {
// mark watch later
$('.cc-save-item.cc-unchecked').click(() => {
let tutorial = getTutorialFromUrl()
markTutorialWatchLater(tutorial)
$('.cc-save-item.cc-checked').show()
$('.cc-save-item.cc-unchecked').hide()
})

$('.cc-mark-as-complete').click(() => {
// unmark watch later
$('.cc-save-item.cc-checked').click(() => {
let tutorial = getTutorialFromUrl()
markTutorialWatchLater(tutorial)
$('.cc-save-item.cc-checked').hide()
$('.cc-save-item.cc-unchecked').show()
})

// mark complete
$('.cc-mark-as-complete.cc-unchecked').click(() => {
let tutorial = getTutorialFromUrl()
markTutorialComplete(tutorial)
$('.cc-mark-as-complete.cc-checked').show()
$('.cc-mark-as-complete.cc-unchecked').hide()
})

// unmark complete
$('.cc-mark-as-complete.cc-checked').click(() => {
let tutorial = getTutorialFromUrl()
markTutorialComplete(tutorial)
$('.cc-mark-as-complete.cc-checked').hide()
$('.cc-mark-as-complete.cc-unchecked').show()
})

0 comments on commit d1edc94

Please sign in to comment.