Skip to content

Instantly share code, notes, and snippets.

@saimonmoore
Forked from jlsync/file.js
Created May 14, 2010 23:30
Show Gist options
  • Save saimonmoore/401829 to your computer and use it in GitHub Desktop.
Save saimonmoore/401829 to your computer and use it in GitHub Desktop.
Sammy example showing how to change location without triggering events
$.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