mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +01:00
Correctly change style if element has more than one class
This commit is contained in:
parent
579d813ec9
commit
165628efc5
@ -216,8 +216,19 @@ function set_style_by_class(t,c,p,v)
|
||||
var node = elements.item(i);
|
||||
for(var j = 0; j < node.attributes.length; j++) {
|
||||
if(node.attributes.item(j).nodeName.toLowerCase() == 'class') {
|
||||
if(node.attributes.item(j).nodeValue == c) {
|
||||
eval('node.style.' + p + " = '" +v + "'");
|
||||
if(node.attributes.item(j).nodeValue.indexOf(' ') == 0) {
|
||||
// Single class
|
||||
if(node.attributes.item(j).nodeValue == c) {
|
||||
eval('node.style.' + p + " = '" +v + "'");
|
||||
}
|
||||
} else {
|
||||
// Multiple classes
|
||||
var classes = node.attributes.item(j).nodeValue.split(' ');
|
||||
for(var k = 0; k < classes.length; k++) {
|
||||
if(classes[k] == c) {
|
||||
eval('node.style.' + p + " = '" +v + "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user