Merge remote-tracking branch 'origin/master' into develop

Conflicts:
	src/app/directives/grafanaPanel.js
	src/app/features/dashboard/dashboardCtrl.js
This commit is contained in:
Torkel Ödegaard 2015-03-05 10:45:27 +01:00
commit f817a8ca3c
4 changed files with 22 additions and 9 deletions

View File

@ -75,6 +75,11 @@ function (angular, app, _, $) {
$button.focus(); $button.focus();
}); });
$scope.$on('$destroy', function() {
$button.unbind();
typeahead.destroy();
});
$compile(elem.contents())($scope); $compile(elem.contents())($scope);
} }
}; };

View File

@ -31,13 +31,6 @@ function (angular, $, config) {
$scope.setupDashboard(dashboard); $scope.setupDashboard(dashboard);
}; };
$scope.registerWindowResizeEvent = function() {
angular.element(window).bind('resize', function() {
$timeout.cancel(resizeEventTimeout);
resizeEventTimeout = $timeout(function() { $scope.$broadcast('render'); }, 200);
});
};
$scope.setupDashboard = function(dashboard) { $scope.setupDashboard = function(dashboard) {
$rootScope.performance.dashboardLoadStart = new Date().getTime(); $rootScope.performance.dashboardLoadStart = new Date().getTime();
$rootScope.performance.panelsInitialized = 0; $rootScope.performance.panelsInitialized = 0;
@ -123,5 +116,15 @@ function (angular, $, config) {
$rootScope.$broadcast('render'); $rootScope.$broadcast('render');
}; };
$scope.registerWindowResizeEvent = function() {
angular.element(window).bind('resize', function() {
$timeout.cancel(resizeEventTimeout);
resizeEventTimeout = $timeout(function() { $scope.$broadcast('render'); }, 200);
});
$scope.$on('$destroy', function() {
angular.element(window).unbind('resize');
});
};
}); });
}); });

View File

@ -1956,7 +1956,7 @@
return items ? this.process(items) : this return items ? this.process(items) : this
} }
, process: function (items) { , process: function (items) {
var that = this var that = this
items = $.grep(items, function (item) { items = $.grep(items, function (item) {
@ -2050,6 +2050,11 @@
.on('click', $.proxy(this.click, this)) .on('click', $.proxy(this.click, this))
.on('mouseenter', 'li', $.proxy(this.mouseenter, this)) .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
.on('mouseleave', 'li', $.proxy(this.mouseleave, this)) .on('mouseleave', 'li', $.proxy(this.mouseleave, this))
},
destroy: function () {
this.$element.off().removeData('typeahead');
this.$menu.off();
} }
, eventSupported: function(eventName) { , eventSupported: function(eventName) {

View File

@ -22,7 +22,7 @@
<!-- build:js app/app.js --> <!-- build:js app/app.js -->
<script src="[[.AppSubUrl]]/public/vendor/require/require.js"></script> <script src="[[.AppSubUrl]]/public/vendor/require/require.js"></script>
<script src="[[.AppSubUrl]]/public/app/components/require.backend.js"></script> <script src="[[.AppSubUrl]]/public/app/components/require.config.js"></script>
<!-- endbuild --> <!-- endbuild -->
</head> </head>