Skip to content

Commit

Permalink
firefox support for selections
Browse files Browse the repository at this point in the history
  • Loading branch information
tgrochowicz committed Jul 1, 2014
1 parent 0af7aa1 commit 5d75e35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plot",
"version": "0.1.2",
"version": "0.1.3",
"homepage": "https://github.com/spoontwisted/plot",
"authors": [
"Rick Ford <[email protected]>"
Expand Down
14 changes: 7 additions & 7 deletions js/jquery.plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -1185,8 +1185,8 @@

// get cursor location, determine if a resize or move event is applicable
self.$el.mousemove(function(e){
rect.x = e.offsetX;
rect.y = e.offsetY;
rect.x = e.offsetX || e.originalEvent.layerX;
rect.y = e.offsetY || e.originalEvent.layerY;

// so jQuery mousemove returns cursor offsetX and offsetY of child elements, not the element you actually selected...
// for divs and spans, fix the cursor position calculation
Expand Down Expand Up @@ -1265,7 +1265,7 @@

// add click location to rect object for move actions
rect.click = {
pos: e.offsetX,
pos: e.offsetX || e.originalEvent.layerX,
from: rect.from,
to: rect.to
}
Expand All @@ -1277,9 +1277,9 @@
self.range.status.resizing = true;

if(self.range.status.resizable === "left"){
rect.from = e.offsetX;
rect.from = e.offsetX || e.originalEvent.layerX;
}else if(self.range.status.resizable === "right"){
rect.to = e.offsetX;
rect.to = e.offsetX || e.originalEvent.layerX;
}
self.$rangeCanvas.css("cursor", "ew-resize");

Expand Down Expand Up @@ -1365,10 +1365,10 @@

if(!self.range.status.selecting){
self.range.status.selecting = true;
rect.from = e.offsetX;
rect.from = e.offsetX || e.originalEvent.layerX;
self.$rangeCanvas.css("cursor", "ew-resize");
}
rect.to = e.offsetX;
rect.to = e.offsetX || e.originalEvent.layerX;

self.drawRange(self.$rangeCanvas, rect.from, rect.to);

Expand Down

0 comments on commit 5d75e35

Please sign in to comment.