lundi 2 mars 2020

How to handle right-click "open in new tab" in EmberJs action?

I have a link which calls an action on click like below. I haven't populated the href because I want this handled in the action and I don't want to trigger a page reload.

HBS

<a class="cursor-pointer" >Next</a>

JS

@action
goToPage(pageName) {
  this.args.pageUpdated('page', pageName.toString());
  // scroll to top of search results
  document.querySelector('.search-summary-title').scrollIntoView();
}

Is there a way to direct the user to the right page if they right-click and choose "open in new tab"?




Aucun commentaire:

Enregistrer un commentaire