mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fixed initialization bugs
This commit is contained in:
parent
1f1959d9b3
commit
7580042b29
@ -136,9 +136,12 @@ function (angular, $, _, appLevelRequire) {
|
|||||||
var $scope = this;
|
var $scope = this;
|
||||||
$scope.requireContext(deps, function () {
|
$scope.requireContext(deps, function () {
|
||||||
var deps = _.toArray(arguments);
|
var deps = _.toArray(arguments);
|
||||||
$scope.$apply(function () {
|
// Check that this is a valid scope.
|
||||||
fn.apply($scope, deps);
|
if($scope.$id) {
|
||||||
});
|
$scope.$apply(function () {
|
||||||
|
fn.apply($scope, deps);
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}]);
|
}]);
|
||||||
|
@ -61,16 +61,22 @@ function (angular) {
|
|||||||
link: function($scope, elem, attr) {
|
link: function($scope, elem, attr) {
|
||||||
// once we have the template, scan it for controllers and
|
// once we have the template, scan it for controllers and
|
||||||
// load the module.js if we have any
|
// load the module.js if we have any
|
||||||
|
var newScope = $scope.$new();
|
||||||
|
|
||||||
// compile the module and uncloack. We're done
|
// compile the module and uncloack. We're done
|
||||||
function loadModule($module) {
|
function loadModule($module) {
|
||||||
$module.appendTo(elem);
|
$module.appendTo(elem);
|
||||||
elem.wrap(container);
|
elem.wrap(container);
|
||||||
/* jshint indent:false */
|
/* jshint indent:false */
|
||||||
$compile(elem.contents())($scope);
|
$compile(elem.contents())(newScope);
|
||||||
elem.removeClass("ng-cloak");
|
elem.removeClass("ng-cloak");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newScope.$on('$destroy',function(){
|
||||||
|
elem.unbind();
|
||||||
|
elem.remove();
|
||||||
|
});
|
||||||
|
|
||||||
$scope.$watch(attr.type, function (name) {
|
$scope.$watch(attr.type, function (name) {
|
||||||
elem.addClass("ng-cloak");
|
elem.addClass("ng-cloak");
|
||||||
// load the panels module file, then render it in the dom.
|
// load the panels module file, then render it in the dom.
|
||||||
|
@ -134,6 +134,9 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
|
|||||||
// here before telling the panels to refresh
|
// here before telling the panels to refresh
|
||||||
this.refresh = function() {
|
this.refresh = function() {
|
||||||
if(self.current.index.interval !== 'none') {
|
if(self.current.index.interval !== 'none') {
|
||||||
|
if(_.isUndefined(filterSrv)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(filterSrv.idsByType('time').length > 0) {
|
if(filterSrv.idsByType('time').length > 0) {
|
||||||
var _range = filterSrv.timeRange('last');
|
var _range = filterSrv.timeRange('last');
|
||||||
kbnIndex.indices(_range.from,_range.to,
|
kbnIndex.indices(_range.from,_range.to,
|
||||||
|
Loading…
Reference in New Issue
Block a user