Slight changes to make the code more readable

master
Magne Bratseth 2016-02-25 09:03:20 +01:00
parent d19cc062c5
commit 0cf2fc57a1
1 changed files with 9 additions and 3 deletions

View File

@ -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];