Moved the isNumeric condition after named conditions in equal.js to prevent erroneous capture of named conditions.

master
Thomas Brierley 2015-05-17 14:34:25 +01:00
parent 923b180f32
commit 9284f56cdb
1 changed files with 7 additions and 7 deletions

View File

@ -121,13 +121,6 @@ Snap.plugin(function (Snap, Element, Paper, glob) {
eve.on("snap.util.equal", function (name, b) {
var A, B, a = Str(this.attr(name) || ""),
el = this;
if (isNumeric(a) && isNumeric(b)) {
return {
from: parseFloat(a),
to: parseFloat(b),
f: getNumber
};
}
if (names[name] == "colour") {
A = Snap.color(a);
B = Snap.color(b);
@ -174,6 +167,13 @@ Snap.plugin(function (Snap, Element, Paper, glob) {
f: function (val) { return val; }
};
}
if (isNumeric(a) && isNumeric(b)) {
return {
from: parseFloat(a),
to: parseFloat(b),
f: getNumber
};
}
var aUnit = a.match(reUnit),
bUnit = Str(b).match(reUnit);
if (aUnit && arrayEqual(aUnit, bUnit)) {