Skip to content

Instantly share code, notes, and snippets.

@jlsync
Forked from quirkey/file.js
Created May 14, 2010 11:57
Show Gist options
  • Save jlsync/401060 to your computer and use it in GitHub Desktop.
Save jlsync/401060 to your computer and use it in GitHub Desktop.
sammy.js get routes without changing the url / location hash
$.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