Skip to content

Commit

Permalink
Resolve ids from list at initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashid Khan committed Jan 17, 2014
1 parent e127506 commit 234094d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/app/services/filterSrv.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ define([
self.set(f,f.id,true);
});

// Date filters hold strings now, not dates
/*
_.each(self.getByType('time',true),function(time) {
self.list[time.id].from = new Date(time.from);
self.list[time.id].to = new Date(time.to);
});
*/

};

// This is used both for adding filters and modifying them.
Expand Down Expand Up @@ -88,6 +80,8 @@ define([
dashboard.refresh();
},0);
}
self.ids = dashboard.current.services.filter.ids =
_.intersection(_.map(self.list,function(v,k){return parseInt(k,10);}),self.ids);
$rootScope.$broadcast('filter');
return _r;
};
Expand Down
3 changes: 3 additions & 0 deletions src/app/services/querySrv.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ function (angular, _, config, kbn) {
self.list = dashboard.current.services.query.list;
self.ids = dashboard.current.services.query.ids;

self.ids = dashboard.current.services.query.ids =
_.intersection(_.map(self.list,function(v,k){return parseInt(k,10);}),self.ids);

// Check each query object, populate its defaults
_.each(self.list,function(query) {
query = self.defaults(query);
Expand Down

0 comments on commit 234094d

Please sign in to comment.