-
-
Save jlsync/401060 to your computer and use it in GitHub Desktop.
sammy.js get routes without changing the url / location hash
This file contains hidden or 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
$.sammy(function() { | |
app.get('#/exams/new', function(context) { | |
// display the modal | |
window.setTimeout( function(){ | |
context.app.location_proxy.unbind(); | |
context.app.setLocation('#/'); | |
context.app.last_location = '#/'; | |
context.app.location_proxy.bind(); | |
}, 55 ); // sammy hack | |
return false; | |
}); | |
app.get('#/exams/:id', function(context) { | |
// display the modal | |
window.setTimeout( function(){ | |
context.app.location_proxy.unbind(); | |
context.app.setLocation('#/'); | |
context.app.last_location = '#/'; | |
context.app.location_proxy.bind(); | |
}, 55 ); // sammy hack | |
return false; | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment