Fix for bug #78

master
Dmitry Baranovskiy 2013-10-30 11:18:42 +11:00
parent 99f10966ea
commit a5d8368e6b
3 changed files with 13 additions and 9 deletions

File diff suppressed because one or more lines are too long

10
dist/snap.svg.js vendored
View File

@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// build: 2013-10-29 // build: 2013-10-30
// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved. // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
@ -4362,13 +4362,15 @@ availableAttributes.feFuncR = availableAttributes.feFuncG = availableAttributes.
offset: 0 offset: 0
}; };
eve.on("snap.util.attr", function (value) { eve.on("snap.util.attr", function (value) {
var att = eve.nt(); var att = eve.nt(),
attr = {};
att = att.substring(att.lastIndexOf(".") + 1); att = att.substring(att.lastIndexOf(".") + 1);
attr[att] = value;
var style = att.replace(/-(\w)/gi, function (all, letter) { var style = att.replace(/-(\w)/gi, function (all, letter) {
return letter.toUpperCase(); return letter.toUpperCase();
}); });
if (availableAttributes[has](this.type) && availableAttributes[this.type][has](att)) { if (availableAttributes[has](this.type) && (availableAttributes[this.type][has](att) || att == "id")) {
value == null ? this.node.removeAttribute(att) : this.node.setAttribute(att, value); $(this.node, attr);
} else { } else {
this.node.style[style] = value == null ? E : value; this.node.style[style] = value == null ? E : value;
} }

View File

@ -3616,13 +3616,15 @@ availableAttributes.feFuncR = availableAttributes.feFuncG = availableAttributes.
offset: 0 offset: 0
}; };
eve.on("snap.util.attr", function (value) { eve.on("snap.util.attr", function (value) {
var att = eve.nt(); var att = eve.nt(),
attr = {};
att = att.substring(att.lastIndexOf(".") + 1); att = att.substring(att.lastIndexOf(".") + 1);
attr[att] = value;
var style = att.replace(/-(\w)/gi, function (all, letter) { var style = att.replace(/-(\w)/gi, function (all, letter) {
return letter.toUpperCase(); return letter.toUpperCase();
}); });
if (availableAttributes[has](this.type) && availableAttributes[this.type][has](att)) { if (availableAttributes[has](this.type) && (availableAttributes[this.type][has](att) || att == "id")) {
value == null ? this.node.removeAttribute(att) : this.node.setAttribute(att, value); $(this.node, attr);
} else { } else {
this.node.style[style] = value == null ? E : value; this.node.style[style] = value == null ? E : value;
} }