Skip to content

Commit

Permalink
Fix mouseup handler (bug when left button is down, then middle or rig…
Browse files Browse the repository at this point in the history
…ht is clicked).
  • Loading branch information
cesutherland committed Mar 13, 2012
1 parent 0d3bedf commit b9155f7
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions js/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,22 +377,19 @@ Graph.prototype = {
}
*/

// @TODO why?
this.mouseUpHandler = _.bind(this.mouseUpHandler, this);

if (this.mouseUpHandler) return;
this.mouseUpHandler = _.bind(function (e) {
E.stopObserving(document, 'mouseup', this.mouseUpHandler);
this.mouseUpHandler = null;
// @TODO why?
//e.stop();
E.fire(this.el, 'flotr:mouseup', [e, this]);
}, this);
E.observe(document, 'mouseup', this.mouseUpHandler);
E.fire(this.el, 'flotr:mousedown', [event, this]);
this.ignoreClick = false;
},
/**
* Observes the mouseup event for the document.
* @param {Event} event - 'mouseup' Event object.
*/
mouseUpHandler: function(event){
E.stopObserving(document, 'mouseup', this.mouseUpHandler);
// @TODO why?
//event.stop();
E.fire(this.el, 'flotr:mouseup', [event, this]);
},
drawTooltip: function(content, x, y, options) {
var mt = this.getMouseTrack(),
style = 'opacity:0.7;background-color:#000;color:#fff;display:none;position:absolute;padding:2px 8px;-moz-border-radius:4px;border-radius:4px;white-space:nowrap;',
Expand Down

0 comments on commit b9155f7

Please sign in to comment.