Fix for plot dimension error when resizing window

This commit is contained in:
Torkel Ödegaard 2014-08-23 20:23:33 +02:00
parent 47a20e6a2f
commit ffbdea78ee
1 changed files with 9 additions and 7 deletions

View File

@ -17,18 +17,20 @@ function (angular, $, config, _) {
$scope.editor = { index: 0 };
$scope.panelNames = config.panels;
var resizeEventTimeout;
$scope.init = function() {
$scope.availablePanels = config.panels;
$scope.onAppEvent('setup-dashboard', $scope.setupDashboard);
angular.element(window).bind('resize', function() {
$timeout(function() {
$scope.$broadcast('render');
});
});
$scope.reset_row();
$scope.registerWindowResizeEvent();
};
$scope.registerWindowResizeEvent = function() {
angular.element(window).bind('resize', function() {
$timeout.cancel(resizeEventTimeout);
resizeEventTimeout = $timeout(function() { $scope.$broadcast('render'); }, 200);
});
};
$scope.setupDashboard = function(event, dashboardData) {