Moved the isNumeric condition after named conditions in equal.js to prevent erroneous capture of named conditions.
parent
923b180f32
commit
9284f56cdb
14
src/equal.js
14
src/equal.js
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue