Last active
June 27, 2017 06:03
-
-
Save fczbkk/1563a0b42b6092f3bded5d6496619520 to your computer and use it in GitHub Desktop.
Inline Manual Player: simple undo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// call this function to display previous step | |
function activatePreviousStep () { | |
var previous_topic = localStorage.getItem('inm_previous_topic'); | |
var previous_step = localStorage.getItem('inm_previous_step'); | |
inline_manual_player.activateStep(previous_topic, previous_step); | |
} | |
// remember topic/step whenever step is deactivated | |
// e.g. when user goes to next step | |
inline_manual_player.setOptions({ | |
callbacks: { | |
onStepDeactivate: function (player, topic_id, step_index) { | |
localStorage.setItem('inm_previous_topic', topic_id); | |
localStorage.setItem('inm_previous_step', step_index); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment