
Presently the timeline directive is a single gigantic directive containing all of the timeline code. Given the amount of code involved, this complicates maintenance and makes it excessively difficult to improve. This refactors the single timeline directive into four separate collaborating directives: a controller, an overview, a viewport, and dstat charts. Each child directive is functionally separate from the others, but can communicate with other chart components via the controller. This separation should greatly improve future maintenance, and has already led to several (included) bug fixes. Change-Id: Id11d15a34466e42c5ebc9808717d52b468245e3a
16 lines
291 B
JavaScript
16 lines
291 B
JavaScript
'use strict';
|
|
|
|
var controllersModule = require('./_index');
|
|
|
|
/**
|
|
* @ngInject
|
|
*/
|
|
function MainCtrl($window, $scope) {
|
|
$window.addEventListener('resize', function () {
|
|
$scope.$broadcast('windowResize');
|
|
$scope.$apply();
|
|
});
|
|
}
|
|
|
|
controllersModule.controller('MainCtrl', MainCtrl);
|