mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix for plot dimension error when resizing window
This commit is contained in:
@@ -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);
|
||||||
|
|
||||||
angular.element(window).bind('resize', function() {
|
|
||||||
$timeout(function() {
|
|
||||||
$scope.$broadcast('render');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.reset_row();
|
$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) {
|
$scope.setupDashboard = function(event, dashboardData) {
|
||||||
|
|||||||
Reference in New Issue
Block a user