mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Performance enhancements
This commit is contained in:
parent
499246abae
commit
7b3df02640
@ -22,6 +22,17 @@ function (angular, _, moment, config) {
|
|||||||
$scope.onAppEvent('zoom-out', function() {
|
$scope.onAppEvent('zoom-out', function() {
|
||||||
$scope.zoom(2);
|
$scope.zoom(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var count = 0;
|
||||||
|
$scope.$watch(function() {
|
||||||
|
console.log(1);
|
||||||
|
count++;
|
||||||
|
}, function(n, o) {
|
||||||
|
});
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
console.log("Total count:" + count);
|
||||||
|
}, 4000);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.set_default = function() {
|
$scope.set_default = function() {
|
||||||
|
@ -60,18 +60,8 @@ function (angular, _) {
|
|||||||
loadController(name);
|
loadController(name);
|
||||||
});
|
});
|
||||||
|
|
||||||
if(attr.panel) {
|
|
||||||
$scope.$watch(attr.panel, function (panel) {
|
|
||||||
// If the panel attribute is specified, create a new scope. This ruins configuration
|
|
||||||
// so don't do it with anything that needs to use editor.html
|
|
||||||
if(!_.isUndefined(panel)) {
|
|
||||||
$scope = $scope.$new();
|
|
||||||
$scope.panel = angular.fromJson(panel);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -88,7 +88,7 @@ function (angular, app, _, require) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!$scope.$$phase) {
|
if(!$scope.$$phase) {
|
||||||
$scope.$apply();
|
$scope.$digest();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user