2015-05-06 04:06:13 +02:00
|
|
|
/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
|
|
|
|
(function() {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
/*
|
|
|
|
* sgFolderStylesheet - Add CSS stylesheet for folder (addressbook or calendar)
|
|
|
|
* @memberof SOGo.Common
|
|
|
|
* @restrict attribute
|
|
|
|
* @param {object} ngModel - the object literal describing the folder (an Addressbook or Calendar instance)
|
|
|
|
* @example:
|
|
|
|
|
|
|
|
<div sg-folder-stylesheet="true"
|
|
|
|
ng-repeat="calendar in calendars.list"
|
|
|
|
ng-model="calendar" />
|
|
|
|
</div>
|
|
|
|
*/
|
|
|
|
function sgFolderStylesheet() {
|
|
|
|
return {
|
|
|
|
restrict: 'A',
|
|
|
|
require: 'ngModel',
|
|
|
|
scope: {
|
|
|
|
ngModel: '='
|
|
|
|
},
|
|
|
|
template: [
|
|
|
|
'<style type="text/css">',
|
|
|
|
' .bg-folder{{ ngModel.id }} {',
|
|
|
|
' background-color: {{ ngModel.color }} !important;',
|
|
|
|
' }',
|
|
|
|
' .fg-folder{{ ngModel.id }} {',
|
|
|
|
' color: {{ ngModel.color }} !important;',
|
|
|
|
' }',
|
2015-05-13 21:25:42 +02:00
|
|
|
' .checkbox-folder{{ ngModel.id }} .md-icon {',
|
2015-05-06 04:06:13 +02:00
|
|
|
' background-color: {{ ngModel.color }} !important;',
|
|
|
|
' }',
|
|
|
|
'</style>'
|
|
|
|
].join('')
|
2015-07-24 22:14:53 +02:00
|
|
|
};
|
2015-05-06 04:06:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
angular
|
|
|
|
.module('SOGo.Common')
|
|
|
|
.directive('sgFolderStylesheet', sgFolderStylesheet);
|
|
|
|
})();
|