Skip to content

Commit 3c49587

Browse files
Final small fixes…
1 parent 6b3fa14 commit 3c49587

5 files changed

+31
-11
lines changed

raphael-min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

raphael.core.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@
387387
return o instanceof Array;
388388
}
389389
return (type == "null" && o === null) ||
390-
(type == typeof o) ||
390+
(type == typeof o && o !== null) ||
391391
(type == "object" && o === Object(o)) ||
392392
(type == "array" && Array.isArray && Array.isArray(o)) ||
393393
objectToString.call(o).slice(8, -1).toLowerCase() == type;
@@ -3483,7 +3483,9 @@
34833483
t = e.t,
34843484
that = e.el,
34853485
set = {},
3486-
now;
3486+
now,
3487+
init = {},
3488+
key;
34873489
if (e.initstatus) {
34883490
time = (e.initstatus * e.anim.top - e.prev) / (e.percent - e.prev) * ms;
34893491
e.status = e.initstatus;
@@ -3574,6 +3576,10 @@
35743576
that.attr(to);
35753577
animationElements.splice(l--, 1);
35763578
if (e.repeat > 1 && !e.next) {
3579+
for (key in to) if (to[has](key)) {
3580+
init[key] = e.totalOrigin[key];
3581+
}
3582+
e.el.attr(init);
35773583
runAnimation(e.anim, e.el, e.anim.percents[0], null, e.totalOrigin, e.repeat - 1);
35783584
}
35793585
if (e.next && !e.stop) {

raphael.js

+15-5
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@
473473
return o instanceof Array;
474474
}
475475
return (type == "null" && o === null) ||
476-
(type == typeof o) ||
476+
(type == typeof o && o !== null) ||
477477
(type == "object" && o === Object(o)) ||
478478
(type == "array" && Array.isArray && Array.isArray(o)) ||
479479
objectToString.call(o).slice(8, -1).toLowerCase() == type;
@@ -2533,7 +2533,9 @@
25332533
t = e.t,
25342534
that = e.el,
25352535
set = {},
2536-
now;
2536+
now,
2537+
init = {},
2538+
key;
25372539
if (e.initstatus) {
25382540
time = (e.initstatus * e.anim.top - e.prev) / (e.percent - e.prev) * ms;
25392541
e.status = e.initstatus;
@@ -2624,6 +2626,10 @@
26242626
that.attr(to);
26252627
animationElements.splice(l--, 1);
26262628
if (e.repeat > 1 && !e.next) {
2629+
for (key in to) if (to[has](key)) {
2630+
init[key] = e.totalOrigin[key];
2631+
}
2632+
e.el.attr(init);
26272633
runAnimation(e.anim, e.el, e.anim.percents[0], null, e.totalOrigin, e.repeat - 1);
26282634
}
26292635
if (e.next && !e.stop) {
@@ -4176,7 +4182,10 @@ window.Raphael.svg && function (R) {
41764182
} else if (name != null && R.is(name, "object")) {
41774183
params = name;
41784184
}
4179-
for (var key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) {
4185+
for (var key in params) {
4186+
eve("attr." + key + "." + this.id, this, params[key]);
4187+
}
4188+
for (key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) {
41804189
var par = this.paper.customAttributes[key].apply(this, [].concat(params[key]));
41814190
this.attrs[key] = params[key];
41824191
for (var subkey in par) if (par[has](subkey)) {
@@ -4819,6 +4828,7 @@ window.Raphael.vml && function (R) {
48194828
addGradientFill = function (o, gradient, fill) {
48204829
o.attrs = o.attrs || {};
48214830
var attrs = o.attrs,
4831+
pow = Math.pow,
48224832
opacity,
48234833
oindex,
48244834
type = "linear",
@@ -5092,11 +5102,11 @@ window.Raphael.vml && function (R) {
50925102
}
50935103
value == null && R.is(name, "object") && (params = name);
50945104
for (var key in params) {
5095-
R.eve("attr." + key + "." + this.id, this, params[key]);
5105+
eve("attr." + key + "." + this.id, this, params[key]);
50965106
}
50975107
if (params) {
50985108
for (key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) {
5099-
var par = this.paper.customAttributes[key].apply(this, [][concat](params[key]));
5109+
var par = this.paper.customAttributes[key].apply(this, [].concat(params[key]));
51005110
this.attrs[key] = params[key];
51015111
for (var subkey in par) if (par[has](subkey)) {
51025112
params[subkey] = par[subkey];

raphael.svg.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,10 @@ window.Raphael.svg && function (R) {
10261026
} else if (name != null && R.is(name, "object")) {
10271027
params = name;
10281028
}
1029-
for (var key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) {
1029+
for (var key in params) {
1030+
eve("attr." + key + "." + this.id, this, params[key]);
1031+
}
1032+
for (key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) {
10301033
var par = this.paper.customAttributes[key].apply(this, [].concat(params[key]));
10311034
this.attrs[key] = params[key];
10321035
for (var subkey in par) if (par[has](subkey)) {

raphael.vml.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ window.Raphael.vml && function (R) {
370370
addGradientFill = function (o, gradient, fill) {
371371
o.attrs = o.attrs || {};
372372
var attrs = o.attrs,
373+
pow = Math.pow,
373374
opacity,
374375
oindex,
375376
type = "linear",
@@ -643,11 +644,11 @@ window.Raphael.vml && function (R) {
643644
}
644645
value == null && R.is(name, "object") && (params = name);
645646
for (var key in params) {
646-
R.eve("attr." + key + "." + this.id, this, params[key]);
647+
eve("attr." + key + "." + this.id, this, params[key]);
647648
}
648649
if (params) {
649650
for (key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) {
650-
var par = this.paper.customAttributes[key].apply(this, [][concat](params[key]));
651+
var par = this.paper.customAttributes[key].apply(this, [].concat(params[key]));
651652
this.attrs[key] = params[key];
652653
for (var subkey in par) if (par[has](subkey)) {
653654
params[subkey] = par[subkey];

0 commit comments

Comments
 (0)