Move js call to the view instead of portal_javascripts
This refs affinitic #5852