Monotone-Parent: 1f7df7709595f90e31a77eb48e262817f79b279f

Monotone-Revision: 6b80a82a1c8467dead7e9167694acac4cd8cae38

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-05-21T21:22:25
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-05-21 21:22:25 +00:00
parent 689b9df4ff
commit c528cefea8
2 changed files with 24 additions and 16 deletions

View File

@@ -1252,10 +1252,11 @@ function resetCategoriesStyles() {
categoriesStyleSheet.removeChild(categoriesStyleSheet.firstChild);
}
// Update stylesheet with new categories colors
var selectors = [];
var rules = [];
categoriesStyles.keys().each(function(category) {
if (UserDefaults['SOGoCalendarCategoriesColors']) {
// Update stylesheet with new categories colors
var selectors = [];
var rules = [];
categoriesStyles.keys().each(function(category) {
var color = UserDefaults['SOGoCalendarCategoriesColors'][category];
if (color) {
rules[rules.length] = '{ border-right: 8px solid ' + color + '; }';
@@ -1263,18 +1264,19 @@ function resetCategoriesStyles() {
}
});
if (selectors.length > 0) {
if (categoriesStyleSheet.styleSheet && categoriesStyleSheet.styleSheet.addRule) {
// IE
for (var i = 0; i < selectors.length; i++)
categoriesStyleSheet.styleSheet.addRule(selectors[i],
rules[i]);
}
else {
// Mozilla + Safari
for (var i = 0; i < selectors.length; i++)
categoriesStyleSheet.appendChild(document.createTextNode(selectors[i] +
' ' + rules[i]));
if (selectors.length > 0) {
if (categoriesStyleSheet.styleSheet && categoriesStyleSheet.styleSheet.addRule) {
// IE
for (var i = 0; i < selectors.length; i++)
categoriesStyleSheet.styleSheet.addRule(selectors[i],
rules[i]);
}
else {
// Mozilla + Safari
for (var i = 0; i < selectors.length; i++)
categoriesStyleSheet.appendChild(document.createTextNode(selectors[i] +
' ' + rules[i]));
}
}
}
}