Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Final small fixes…

  • Loading branch information...
commit 3c49587c2bebd61d7e95182e26fccd6c8bcc6648 1 parent 6b3fa14
Dmitry Baranovskiy authored October 01, 2011
2  raphael-min.js
1 addition, 1 deletion not shown
10  raphael.core.js
@@ -387,7 +387,7 @@
387 387
             return o instanceof Array;
388 388
         }
389 389
         return  (type == "null" && o === null) ||
390  
-                (type == typeof o) ||
  390
+                (type == typeof o && o !== null) ||
391 391
                 (type == "object" && o === Object(o)) ||
392 392
                 (type == "array" && Array.isArray && Array.isArray(o)) ||
393 393
                 objectToString.call(o).slice(8, -1).toLowerCase() == type;
@@ -3483,7 +3483,9 @@
3483 3483
                     t = e.t,
3484 3484
                     that = e.el,
3485 3485
                     set = {},
3486  
-                    now;
  3486
+                    now,
  3487
+                    init = {},
  3488
+                    key;
3487 3489
                 if (e.initstatus) {
3488 3490
                     time = (e.initstatus * e.anim.top - e.prev) / (e.percent - e.prev) * ms;
3489 3491
                     e.status = e.initstatus;
@@ -3574,6 +3576,10 @@
3574 3576
                     that.attr(to);
3575 3577
                     animationElements.splice(l--, 1);
3576 3578
                     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);
3577 3583
                         runAnimation(e.anim, e.el, e.anim.percents[0], null, e.totalOrigin, e.repeat - 1);
3578 3584
                     }
3579 3585
                     if (e.next && !e.stop) {
20  raphael.js
@@ -473,7 +473,7 @@
473 473
             return o instanceof Array;
474 474
         }
475 475
         return  (type == "null" && o === null) ||
476  
-                (type == typeof o) ||
  476
+                (type == typeof o && o !== null) ||
477 477
                 (type == "object" && o === Object(o)) ||
478 478
                 (type == "array" && Array.isArray && Array.isArray(o)) ||
479 479
                 objectToString.call(o).slice(8, -1).toLowerCase() == type;
@@ -2533,7 +2533,9 @@
2533 2533
                     t = e.t,
2534 2534
                     that = e.el,
2535 2535
                     set = {},
2536  
-                    now;
  2536
+                    now,
  2537
+                    init = {},
  2538
+                    key;
2537 2539
                 if (e.initstatus) {
2538 2540
                     time = (e.initstatus * e.anim.top - e.prev) / (e.percent - e.prev) * ms;
2539 2541
                     e.status = e.initstatus;
@@ -2624,6 +2626,10 @@
2624 2626
                     that.attr(to);
2625 2627
                     animationElements.splice(l--, 1);
2626 2628
                     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);
2627 2633
                         runAnimation(e.anim, e.el, e.anim.percents[0], null, e.totalOrigin, e.repeat - 1);
2628 2634
                     }
2629 2635
                     if (e.next && !e.stop) {
@@ -4176,7 +4182,10 @@ window.Raphael.svg && function (R) {
4176 4182
         } else if (name != null && R.is(name, "object")) {
4177 4183
             params = name;
4178 4184
         }
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")) {
4180 4189
             var par = this.paper.customAttributes[key].apply(this, [].concat(params[key]));
4181 4190
             this.attrs[key] = params[key];
4182 4191
             for (var subkey in par) if (par[has](subkey)) {
@@ -4819,6 +4828,7 @@ window.Raphael.vml && function (R) {
4819 4828
     addGradientFill = function (o, gradient, fill) {
4820 4829
         o.attrs = o.attrs || {};
4821 4830
         var attrs = o.attrs,
  4831
+            pow = Math.pow,
4822 4832
             opacity,
4823 4833
             oindex,
4824 4834
             type = "linear",
@@ -5092,11 +5102,11 @@ window.Raphael.vml && function (R) {
5092 5102
         }
5093 5103
         value == null && R.is(name, "object") && (params = name);
5094 5104
         for (var key in params) {
5095  
-            R.eve("attr." + key + "." + this.id, this, params[key]);
  5105
+            eve("attr." + key + "." + this.id, this, params[key]);
5096 5106
         }
5097 5107
         if (params) {
5098 5108
             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]));
5100 5110
                 this.attrs[key] = params[key];
5101 5111
                 for (var subkey in par) if (par[has](subkey)) {
5102 5112
                     params[subkey] = par[subkey];
5  raphael.svg.js
@@ -1026,7 +1026,10 @@ window.Raphael.svg && function (R) {
1026 1026
         } else if (name != null && R.is(name, "object")) {
1027 1027
             params = name;
1028 1028
         }
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")) {
1030 1033
             var par = this.paper.customAttributes[key].apply(this, [].concat(params[key]));
1031 1034
             this.attrs[key] = params[key];
1032 1035
             for (var subkey in par) if (par[has](subkey)) {
5  raphael.vml.js
@@ -370,6 +370,7 @@ window.Raphael.vml && function (R) {
370 370
     addGradientFill = function (o, gradient, fill) {
371 371
         o.attrs = o.attrs || {};
372 372
         var attrs = o.attrs,
  373
+            pow = Math.pow,
373 374
             opacity,
374 375
             oindex,
375 376
             type = "linear",
@@ -643,11 +644,11 @@ window.Raphael.vml && function (R) {
643 644
         }
644 645
         value == null && R.is(name, "object") && (params = name);
645 646
         for (var key in params) {
646  
-            R.eve("attr." + key + "." + this.id, this, params[key]);
  647
+            eve("attr." + key + "." + this.id, this, params[key]);
647 648
         }
648 649
         if (params) {
649 650
             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]));
651 652
                 this.attrs[key] = params[key];
652 653
                 for (var subkey in par) if (par[has](subkey)) {
653 654
                     params[subkey] = par[subkey];

0 notes on commit 3c49587

Please sign in to comment.
Something went wrong with that request. Please try again.