Fix initial panel state given an error state, fix attempt to destroy error state vis. Closes #247

This commit is contained in:
Rashid Khan 2014-08-13 09:46:06 -07:00
parent 6791c627d4
commit 756d969e76
2 changed files with 3 additions and 2 deletions

View file

@ -82,7 +82,7 @@ define(function (require) {
makePanelSerializeable(panel);
});
});
safeLayout();
$window.on('resize', safeLayout);
$scope.$on('ready:vis', safeLayout);
};

View file

@ -141,7 +141,8 @@ define(function (require) {
});
$scope.$on('$destroy', function () {
if ($scope.vis) $scope.vis.destroy();
// Vis with missing indexpattern will not have destroy
if ($scope.vis && $scope.vis.destroy) $scope.vis.destroy();
if (chart) {
chart.off('hover');
chart.off('click');