Skip to content

Commit

Permalink
If there is no browser history, exit the slideshow by calling stop.
Browse files Browse the repository at this point in the history
  • Loading branch information
setnes committed Dec 5, 2015
1 parent 7ac4ab4 commit 5ee22c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/slideshowcontrols.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,11 @@
_exit: function () {

// Only modern browsers can manipulate history
if (history && history.replaceState) {
if (history && history.replaceState && window.history.length > 1) {
// We simulate a click on the back button in order to be consistent
window.history.back();
} else {
// For ancient browsers supported in core
// There is no history to go back to.
this.stop();
}
},
Expand Down

0 comments on commit 5ee22c3

Please sign in to comment.