mirror of
https://github.com/valitydev/redash.git
synced 2024-11-08 01:48:54 +00:00
Merge pull request #157 from EverythingMe/fix_dashboard_watch
Fix: some dashboards get into infinite loop of watches
This commit is contained in:
commit
23a3a7f20e
@ -31,14 +31,14 @@
|
||||
'<div class="panel-heading">{name}' +
|
||||
'</div></li>';
|
||||
|
||||
$scope.$watch('dashboard.widgets', function(widgets) {
|
||||
$scope.$watch('dashboard.widgets && dashboard.widgets.length', function(widgets_length) {
|
||||
$timeout(function() {
|
||||
gridster.remove_all_widgets();
|
||||
|
||||
if (widgets && widgets.length) {
|
||||
if ($scope.dashboard.widgets && $scope.dashboard.widgets.length) {
|
||||
var layout = [];
|
||||
|
||||
_.each(widgets, function(row, rowIndex) {
|
||||
_.each($scope.dashboard.widgets, function(row, rowIndex) {
|
||||
_.each(row, function(widget, colIndex) {
|
||||
layout.push({
|
||||
id: widget.id,
|
||||
@ -58,7 +58,7 @@
|
||||
});
|
||||
}
|
||||
});
|
||||
}, true);
|
||||
});
|
||||
|
||||
$scope.saveDashboard = function() {
|
||||
$scope.saveInProgress = true;
|
||||
|
Loading…
Reference in New Issue
Block a user