Refactor setExtremes.

This commit is contained in:
Alexis Lahouze 2015-08-20 11:41:43 +02:00
parent c819b62246
commit ad60e19617

View File

@ -171,7 +171,6 @@ accountantApp
"SoldChartController", [
"$rootScope", "$scope", "$http", "$routeParams",
function($rootScope, $scope, $http, $routeParams) {
// Configure chart for entries.
$scope.config = {
options: {
@ -240,7 +239,9 @@ accountantApp
minRange: 3600 * 1000 * 24 * 14, // 2 weeks
events: {
afterSetExtremes: function(e) {
$scope.selectRange(moment.utc(e.min), moment.utc(e.max));
$scope.$emit("rangeSelectedEvent", {
begin: moment.utc(e.min), end: moment.utc(e.max)
});
}
},
currentMin: moment.utc().startOf('month'),
@ -260,10 +261,6 @@ accountantApp
useHighStocks: true
};
$scope.selectRange = function(begin, end) {
$scope.$emit("rangeSelectedEvent", {begin: begin, end: end});
};
$scope.loadSolds = function() {
$scope.config.loading = true;