vojtech-dobes / history.nette.ajax.js

Adds History API support to nette.ajax.js addon!
30 stars 27 forks source link

Hashtag in redirect is lost #9

Closed VojtaSim closed 10 years ago

VojtaSim commented 10 years ago

Hi, when I add a hastag into redirect like this:

$this->redirect('Presenter:action#HASH');

the browser receives a correct url but wihout the #HASH. Found out the problem is caused be generating the url again here. After some debugging I discovered the method __invoke is called twice;

  1. first time the payload contains correct redirect
  2. and second time there're only snippets and state objects Can you please explain why's it like that?

I need that hashtag to open a bootstrap modal so I've tried to workaround this by writing own extension that opens modals by showModal property in the payload but when I set it in a presenter like this:

$this->payload->showModal = 'ModalID';
$this->redirect('Presenter:action');

It doesn't work either. The browser receives only snippets and a wrong redirect.