1.4.1 v1.4.1
authorDmitryBaranovskiy <dmitry@baranovskiy.com>
Fri, 7 May 2010 21:58:48 +0000 (07:58 +1000)
committerDmitryBaranovskiy <dmitry@baranovskiy.com>
Fri, 7 May 2010 21:58:48 +0000 (07:58 +1000)
• Small bug fix in multi-touch implementation

raphael.js

index d3d79bb..796eb66 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * Raphael 1.4 - JavaScript Vector Library
+ * Raphael 1.4.1 - JavaScript Vector Library
  *
  * Copyright (c) 2010 Dmitry Baranovskiy (http://raphaeljs.com)
  * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
@@ -19,7 +19,7 @@ Raphael = (function () {
         }
         return create[apply](R, arguments);
     }
-    R.version = "1.4";
+    R.version = "1.4.1";
     var separator = /[, ]+/,
         elements = /^(circle|rect|path|ellipse|text|image)$/,
         proto = "prototype",
@@ -2487,7 +2487,7 @@ Raphael = (function () {
             return function (obj, type, fn, element) {
                 var f = function (e) {
                     if (supportsTouch) {
-                        for (var i = 0, ii = e.targetTouches.length; i < ii; i++) {
+                        for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {
                             if (e.targetTouches[i].target == obj) {
                                 var olde = e;
                                 e = e.targetTouches[i];
@@ -2553,7 +2553,7 @@ Raphael = (function () {
     Element[proto].drag = function (onmove, onstart, onend) {
         this._drag = {};
         var el = this.mousedown(function (e) {
-            e.preventDefault();
+            (e.originalEvent ? e.originalEvent : e).preventDefault();
             this._drag.x = e.clientX;
             this._drag.y = e.clientY;
             this._drag.id = e.identifier;
@@ -2571,7 +2571,7 @@ Raphael = (function () {
                         if (touch.identifier == el._drag.id) {
                             x = touch.clientX;
                             y = touch.clientY;
-                            e.preventDefault();
+                            (e.originalEvent ? e.originalEvent : e).preventDefault();
                             break;
                         }
                     }