mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
41 lines
957 B
JavaScript
41 lines
957 B
JavaScript
define([
|
|
'lodash',
|
|
'jquery',
|
|
'../core_module',
|
|
],
|
|
function (_, $, coreModule) {
|
|
'use strict';
|
|
|
|
coreModule.default.directive('bodyClass', function() {
|
|
return {
|
|
link: function($scope, elem) {
|
|
|
|
var lastHideControlsVal;
|
|
|
|
// tooltip removal fix
|
|
$scope.$on("$routeChangeSuccess", function() {
|
|
$("#tooltip, .tooltip").remove();
|
|
});
|
|
|
|
$scope.$watch('dashboard.hideControls', function() {
|
|
if (!$scope.dashboard) {
|
|
return;
|
|
}
|
|
|
|
var hideControls = $scope.dashboard.hideControls || $scope.playlist_active;
|
|
|
|
if (lastHideControlsVal !== hideControls) {
|
|
elem.toggleClass('hide-controls', hideControls);
|
|
lastHideControlsVal = hideControls;
|
|
}
|
|
});
|
|
|
|
$scope.$watch('playlistSrv', function(newValue) {
|
|
elem.toggleClass('playlist-active', _.isObject(newValue));
|
|
});
|
|
}
|
|
};
|
|
});
|
|
|
|
});
|