1
votes

I'm using backbonejs w/ routes and I'd like to know when a person has clicked on the same route that they are already on.

For example, if they are on /#/home, then they click a link again for the same route. I tried to bind all, but it only seems to register if a route is actually changed.

Thanks!

1

1 Answers

0
votes

I don't know what you're trying to achieve, but the following may help:

Backbone.history.on('all', function (name, e, route) {
    if(route === lastroute) {
        refresh();
    }
}

Be sure to use Backbone.history.navigate('home', {trigger: true}) if you use this kind of navigation.