1

In my Backbone application, I am opening a modal window that changes the URL.

The application loads at the URL of http://application.dev/#dashboard opening the modal changes the URL but does not trigger a route, the URL is changed too `http://application.dev/#project/create.

On closing the modal I am wanting to navigate back to the last URL, currently I am trying the following,

$('#myModal').on('hidden.bs.modal', function () {
    self.remove();
    App.Routes.Application.navigate(Backbone.history.location.hash, { trigger: true } );
});

However the last route is not triggered and URL is not changed, I am obviously doing something wrong?

Udders
  • 6,914
  • 24
  • 102
  • 194

1 Answers1

0

Some possible help:

put self.remove(); after having trigger the rout

Declare pushState:true for your router

I hope it helps.

François Richard
  • 6,817
  • 10
  • 43
  • 78