Slight changes to make the code more readable
parent
d19cc062c5
commit
0cf2fc57a1
|
@ -620,7 +620,6 @@ svgedit.utilities.assignAttributes = function(node, attrs, suspendLength, unitCh
|
|||
// Parameters:
|
||||
// element - DOM element to clean up
|
||||
svgedit.utilities.cleanupElement = function(element) {
|
||||
var nodeName = element.nodeName ? element.nodeName : '';
|
||||
var defaults = {
|
||||
'fill-opacity':1,
|
||||
'stop-opacity':1,
|
||||
|
@ -631,10 +630,17 @@ svgedit.utilities.cleanupElement = function(element) {
|
|||
'stroke-linecap':'butt',
|
||||
'stroke-opacity':1,
|
||||
'stroke-width':1,
|
||||
'rx': (nodeName == 'ellipse' ? null : 0), // rx=0 and ry=0 is valid value which are different than null/empty
|
||||
'ry': (nodeName == 'ellipse' ? null : 0)
|
||||
'rx': 0,
|
||||
'ry': 0
|
||||
};
|
||||
|
||||
var nodeName = element.nodeName ? element.nodeName : '';
|
||||
if (nodeName == 'ellipse') {
|
||||
// Ellipse elements requires rx and ry attributes
|
||||
delete defaults.rx;
|
||||
delete defaults.ry;
|
||||
}
|
||||
|
||||
var attr;
|
||||
for (attr in defaults) {
|
||||
var val = defaults[attr];
|
||||
|
|
Loading…
Reference in New Issue