kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Add error checking to $tw.utils.setStyle()
rodzic
2d99f4dc15
commit
b132e1023d
|
@ -18,11 +18,13 @@ Set style properties of an element
|
|||
styles: ordered array of {name: value} pairs
|
||||
*/
|
||||
exports.setStyle = function(element,styles) {
|
||||
if(element.nodeType === Element.ELEMENT_NODE) {
|
||||
for(var t=0; t<styles.length; t++) {
|
||||
for(var styleName in styles[t]) {
|
||||
element.style[$tw.utils.convertStyleNameToPropertyName(styleName)] = styles[t][styleName];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
Ładowanie…
Reference in New Issue