ui/lib/global-admin/addon/clusters/index/route.js

20 lines
437 B
JavaScript

import { next } from '@ember/runloop';
import Route from '@ember/routing/route';
export default Route.extend({
actions: {
toggleGrouping() {
let choices = ['list','grouped'];
let cur = this.get('controller.mode');
let neu = choices[((choices.indexOf(cur)+1) % choices.length)];
next(() => {
this.set('controller.mode', neu);
});
},
},
shortcuts: {
'g': 'toggleGrouping',
}
});