Commit 3fd9c787 by Daniel Lee Committed by GitHub

Merge pull request #11497 from grafana/dash-class-to-ts

migrated dash_class to ts
parents 51148709 714d555e
define([ import _ from 'lodash';
'lodash', import coreModule from '../core_module';
'jquery',
'../core_module',
],
function (_, $, coreModule) {
'use strict';
coreModule.default.directive('dashClass', function() { /** @ngInject */
return { export function dashClass() {
link: function($scope, elem) { return {
link: function($scope, elem) {
$scope.onAppEvent('panel-fullscreen-enter', function() {
elem.toggleClass('panel-in-fullscreen', true);
});
$scope.onAppEvent('panel-fullscreen-enter', function() { $scope.onAppEvent('panel-fullscreen-exit', function() {
elem.toggleClass('panel-in-fullscreen', true); elem.toggleClass('panel-in-fullscreen', false);
}); });
$scope.onAppEvent('panel-fullscreen-exit', function() { $scope.$watch('ctrl.dashboardViewState.state.editview', function(newValue) {
elem.toggleClass('panel-in-fullscreen', false); if (newValue) {
}); elem.toggleClass('dashboard-page--settings-opening', _.isString(newValue));
setTimeout(function() {
elem.toggleClass('dashboard-page--settings-open', _.isString(newValue));
}, 10);
} else {
elem.removeClass('dashboard-page--settings-opening');
elem.removeClass('dashboard-page--settings-open');
}
});
},
};
}
$scope.$watch('ctrl.dashboardViewState.state.editview', function(newValue) { coreModule.directive('dashClass', dashClass);
if (newValue) {
elem.toggleClass('dashboard-page--settings-opening', _.isString(newValue));
setTimeout(function() {
elem.toggleClass('dashboard-page--settings-open', _.isString(newValue));
}, 10);
} else {
elem.removeClass('dashboard-page--settings-opening');
elem.removeClass('dashboard-page--settings-open');
}
});
}
};
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment