2015-09-15 14:17:40 +08:00
|
|
|
define([
|
|
|
|
|
'lodash',
|
|
|
|
|
'jquery',
|
|
|
|
|
'../core_module',
|
|
|
|
|
],
|
|
|
|
|
function (_, $, coreModule) {
|
|
|
|
|
'use strict';
|
|
|
|
|
|
2016-02-13 01:55:45 +08:00
|
|
|
coreModule.default.directive('dashClass', function() {
|
2015-09-15 14:17:40 +08:00
|
|
|
return {
|
|
|
|
|
link: function($scope, elem) {
|
|
|
|
|
|
2016-02-07 19:28:06 +08:00
|
|
|
$scope.onAppEvent('panel-fullscreen-enter', function() {
|
|
|
|
|
elem.toggleClass('panel-in-fullscreen', true);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$scope.onAppEvent('panel-fullscreen-exit', function() {
|
|
|
|
|
elem.toggleClass('panel-in-fullscreen', false);
|
|
|
|
|
});
|
|
|
|
|
|
2016-04-16 03:11:40 +08:00
|
|
|
$scope.$watch('dashboard.editMode', function() {
|
2015-09-15 14:17:40 +08:00
|
|
|
if (!$scope.dashboard) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-16 03:11:40 +08:00
|
|
|
var editMode = $scope.dashboard.editMode;
|
|
|
|
|
elem.toggleClass('dash-edit-mode', editMode === true);
|
2015-09-15 14:17:40 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$scope.$watch('playlistSrv', function(newValue) {
|
|
|
|
|
elem.toggleClass('playlist-active', _.isObject(newValue));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|