mercredi 24 juin 2015

emberjs desired page wont open on "right click open in new tab"

So here is the javascript class emberjs code with

export default Ember.Controller.extend({:
....
....
....
....
showUser() {
  this.replaceRoute('user', this.get('user'));
  this.close();
}

and this is the handlebars with html file code:

<a href {{action "showUser"}}>{{username}} {{user-status user currentUser=currentUser}}</a>

The app is on Ruby on Rails.

There is a topics page and a user profile page. What this does is opens up a pop up user badge and allow users to click on the usernames and it redirects them to that users profile page. Clicking this works fine and redirects the user to the user page from this topics page that they are on. But I would like users to RIGHT CLICK, OPEN IN NEW TAB. That just opens the same topics page.

After researching on ember I came to find out the transitionToRoute in the first piece of code shows that the model probably is serialized into the URL, ultimately using the serialized hook of the rout. Why do I think that this is the cause? I don't know! I also tried replaceRoute method but that does the same. Help? :)




Aucun commentaire:

Enregistrer un commentaire