From 95f080e9f4dd1bfcd45541e6120df0be65547b6f Mon Sep 17 00:00:00 2001 From: Martijn Date: Sat, 28 Mar 2015 00:58:50 +0100 Subject: [PATCH] Fixes issue #3 Firefox's mouse events have no .x and .y properties, they're called .clientX and .clientY. [According to the mdn](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/clientX#Browser_compatibility), clientX and clientY are supported on all major browsers. --- editor/plugins/scrubbable.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/editor/plugins/scrubbable.html b/editor/plugins/scrubbable.html index 8b6d954..c89df2a 100644 --- a/editor/plugins/scrubbable.html +++ b/editor/plugins/scrubbable.html @@ -43,11 +43,11 @@ var self = this; handleDrag(el, { start: function(e) { - origin = { x: e.x, y: e.y }; + origin = { x: e.clientX, y: e.clientY }; document.body.classList.add('mc-scrubbing'); }, drag: function(e) { - el.textContent = originalValue + (e.x - origin.x); + el.textContent = originalValue + (e.clientX - origin.x); }, end: function(e) { document.body.classList.remove('mc-scrubbing'); @@ -69,4 +69,4 @@ }); }); }); - \ No newline at end of file +