Commit ffbdea78 by Torkel Ödegaard

Fix for plot dimension error when resizing window

parent 47a20e6a
...@@ -17,18 +17,20 @@ function (angular, $, config, _) { ...@@ -17,18 +17,20 @@ function (angular, $, config, _) {
$scope.editor = { index: 0 }; $scope.editor = { index: 0 };
$scope.panelNames = config.panels; $scope.panelNames = config.panels;
var resizeEventTimeout;
$scope.init = function() { $scope.init = function() {
$scope.availablePanels = config.panels; $scope.availablePanels = config.panels;
$scope.onAppEvent('setup-dashboard', $scope.setupDashboard); $scope.onAppEvent('setup-dashboard', $scope.setupDashboard);
$scope.reset_row();
$scope.registerWindowResizeEvent();
};
$scope.registerWindowResizeEvent = function() {
angular.element(window).bind('resize', function() { angular.element(window).bind('resize', function() {
$timeout(function() { $timeout.cancel(resizeEventTimeout);
$scope.$broadcast('render'); resizeEventTimeout = $timeout(function() { $scope.$broadcast('render'); }, 200);
});
}); });
$scope.reset_row();
}; };
$scope.setupDashboard = function(event, dashboardData) { $scope.setupDashboard = function(event, dashboardData) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment