Created
July 9, 2017 21:00
-
-
Save benzkji/cc2d9439c7a74a0a592d32090fd14930 to your computer and use it in GitHub Desktop.
back pattern revisited
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
// check: if we came frome our own site, just use history.back() | |
// as simple as it gets. | |
on_back_click: function(e) { | |
// this check could be further enhanced, but works quite well already. | |
if (document.referrer.indexOf(window.location.host) !== -1) { | |
e.preventDefault(); | |
history.back(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment