github.com/blixtra/nomad@v0.7.2-0.20171221000451-da9a1d7bb050/ui/app/mixins/with-namespace-resetting.js (about)

     1  import Ember from 'ember';
     2  
     3  const { Mixin, inject } = Ember;
     4  
     5  export default Mixin.create({
     6    system: inject.service(),
     7    jobsController: inject.controller('jobs'),
     8  
     9    actions: {
    10      gotoJobs(namespace) {
    11        // Since the setupController hook doesn't fire when transitioning up the
    12        // route hierarchy, the two sides of the namespace bindings need to be manipulated
    13        // in order for the jobs route model to reload.
    14        this.set('system.activeNamespace', this.get('jobsController.jobNamespace'));
    15        this.set('jobsController.jobNamespace', namespace.get('id'));
    16        this.transitionToRoute('jobs');
    17      },
    18    },
    19  });