| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- define([
- 'lodash',
- 'jquery',
- '../core_module',
- ],
- function (_, $, coreModule) {
- 'use strict';
- coreModule.default.directive('dashClass', function() {
- return {
- link: function($scope, elem) {
- $scope.onAppEvent('panel-fullscreen-enter', function() {
- elem.toggleClass('panel-in-fullscreen', true);
- });
- $scope.onAppEvent('panel-fullscreen-exit', function() {
- elem.toggleClass('panel-in-fullscreen', false);
- });
- var lastHideControlsVal;
- $scope.$watch('ctrl.dashboard.hideControls', function() {
- if (!$scope.dashboard) {
- return;
- }
- var hideControls = $scope.dashboard.hideControls;
- if (lastHideControlsVal !== hideControls) {
- elem.toggleClass('hide-controls', hideControls);
- lastHideControlsVal = hideControls;
- }
- });
- $scope.$watch('ctrl.playlistSrv.isPlaying', function(newValue) {
- elem.toggleClass('playlist-active', newValue === true);
- });
- $scope.$watch('ctrl.dashboardViewState.state.editview', function(newValue) {
- 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');
- }
- });
- }
- };
- });
- });
|