merge of '0891f9bac2704aa4c0ef0224c54360af14c5618a'

and '7bb42646015cb99b0c6dfe942e088aba59cc5991'

Monotone-Parent: 0891f9bac2704aa4c0ef0224c54360af14c5618a
Monotone-Parent: 7bb42646015cb99b0c6dfe942e088aba59cc5991
Monotone-Revision: c7bedf71e117aebb3c471ca7dafef74ece6a678a

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2010-05-16T19:24:36
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2010-05-16 19:24:36 +00:00
5 changed files with 39 additions and 22 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]));
}
}
}
}