From 09f7873a08d7a82ccf979a8792f0ec402ef9e124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihhail=20Lapu=C5=A1kin?= Date: Sun, 25 Aug 2013 12:24:20 +0300 Subject: [PATCH] Resolved compatibility issues with CocoonJS --- src/DragAndDrop.js | 2 +- src/Stage.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DragAndDrop.js b/src/DragAndDrop.js index 8bcdfd27..ed1c1d68 100644 --- a/src/DragAndDrop.js +++ b/src/DragAndDrop.js @@ -228,7 +228,7 @@ Kinetic.Node.prototype.isDraggable = Kinetic.Node.prototype.getDraggable; - var html = document.getElementsByTagName('html')[0]; + var html = document.documentElement; html.addEventListener('mouseup', Kinetic.DD._endDragBefore, true); html.addEventListener('touchend', Kinetic.DD._endDragBefore, true); diff --git a/src/Stage.js b/src/Stage.js index 7bc58415..b79ad97c 100644 --- a/src/Stage.js +++ b/src/Stage.js @@ -549,7 +549,7 @@ } }, _getContentPosition: function() { - var rect = this.content.getBoundingClientRect(); + var rect = this.content.getBoundingClientRect ? this.content.getBoundingClientRect() : { top: 0, left: 0 }; return { top: rect.top, left: rect.left