aboutsummaryrefslogtreecommitdiff
path: root/javascript/app/controllers/package/index.js
blob: cd02416d0bcb784daef27a44c4ee56f76840dd27 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import Ember from 'ember';
export default Ember.Controller.extend({
  modulesFiltered : Ember.computed('model','query',function () {
    const query = this.get('query');
    const modules = Object.keys(this.get('model.modules')).sort();    
    if(query) {
      const regExp = new RegExp(query,"i");
      return modules.filter((p) => p.search(regExp) != -1);
    } else {
      return modules;
    }
  })
});