Merge pull request #338 from helsinki-systems/escape-css-selectors

fix(calendar(js)): escape CSS selector names (@leonklingele)
This commit is contained in:
WoodySlum
2024-06-04 11:15:10 +02:00
committed by GitHub
2 changed files with 21 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/**
* @type {angular.Module}
*/
(function () {
'use strict';
/**
* @ngInject
*/
cssEscape.$inject = ['$window'];
function cssEscape($window) {
return $window.CSS.escape;
}
angular.module('SOGo.Common')
.filter('cssEscape', cssEscape);
})();

View File

@@ -26,11 +26,11 @@
template: [
'<style type="text/css">',
/* Background color */
' .bg-category{{ ngModel.id }} {',
' .bg-category{{ ngModel.id | cssEscape }} {',
' background-color: {{ ngModel.color }} !important;',
' }',
/* Border color */
' .bdr-category{{ ngModel.id }} {',
' .bdr-category{{ ngModel.id | cssEscape }} {',
' border-color: {{ ngModel.color }} !important;',
' }',
'</style>'