Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

URL resolving at runtime has issues with hashbangs in URL #113

Closed
schlundd opened this Issue Dec 20, 2012 · 6 comments

Comments

Projects
None yet
2 participants

runtime.resolve() in runtime.js doesn't work correctly when using hashbangs. Fixed it by including:

  var hashbang = prefix.indexOf('#');
  if (hashbang != -1){
    prefix = prefix.substring(0,hashbang);
  }

after line 303.

@ghost ghost assigned bminer Jan 2, 2013

Owner

bminer commented Jan 2, 2013

Thanks for the bug report. Unfortunately, I cannot replicate this bug. What, specifically, is causing the problem?

schlundd commented Jan 3, 2013

Yeah, sorry. I guess my report didn't really say much.

I have a single page ajax app. When someone navigates to /#cases/undefined I want to load a template called "caseCreate" by calling blade.Runtime.loadTemplate(). However, because of the slash after the hash in the URL, runtime.resolve() (used by loadTemplate) returns "eate.blade" instead of "caseCreate.blade". As far as I see, this could be fixed by cutting of the prefix variable at the hash.

Hope this helps.

Owner

bminer commented Jan 3, 2013

@schlundd - Gotcha. I think I understand the problem now. So, what filename are you passing to loadTemplate? I am trying to figure out what string gets passed to runtime.resolve(), what you expect as output, and what it actually returns as output. Thanks!

Owner

bminer commented Jan 3, 2013

Also... what browser are you using that causes this problem?

schlundd commented Jan 4, 2013

Sure. I call loadTemplate("caseCreate", cb). This triggers the call runtime.resolve("caseCreate.blade"), wich returns "eate.blade", but should return "caseCreate.blade". window.location.href is "http://<host>:<port>/#cases/undefined". I don't think it's browser specific. Tested on FF 17 and Chrome 23.

Owner

bminer commented Jan 4, 2013

@schlundd - Got it, thanks! This will be fixed shortly!

@bminer bminer closed this in dc62e5a Jan 4, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment