Mouseover behaviour fixes (#684)

* fix broken tooltips

* use bindEvent to make mouseover and mouseout work in the flyout
This commit is contained in:
Rachel Fenichel
2016-10-11 10:55:42 -07:00
committed by picklesrus
parent e1ae3f4aa8
commit acaf81185e
2 changed files with 6 additions and 6 deletions

View File

@@ -845,13 +845,13 @@ Blockly.Flyout.prototype.addBlockListeners_ = function(root, block, rect) {
this.blockMouseDown_(block)));
this.listeners_.push(Blockly.bindEventWithChecks_(rect, 'mousedown', null,
this.blockMouseDown_(block)));
this.listeners_.push(Blockly.bindEventWithChecks_(root, 'mouseover', block,
this.listeners_.push(Blockly.bindEvent_(root, 'mouseover', block,
block.addSelect));
this.listeners_.push(Blockly.bindEventWithChecks_(root, 'mouseout', block,
this.listeners_.push(Blockly.bindEvent_(root, 'mouseout', block,
block.removeSelect));
this.listeners_.push(Blockly.bindEventWithChecks_(rect, 'mouseover', block,
this.listeners_.push(Blockly.bindEvent_(rect, 'mouseover', block,
block.addSelect));
this.listeners_.push(Blockly.bindEventWithChecks_(rect, 'mouseout', block,
this.listeners_.push(Blockly.bindEvent_(rect, 'mouseout', block,
block.removeSelect));
};

View File

@@ -131,9 +131,9 @@ Blockly.Tooltip.createDom = function() {
* @param {!Element} element SVG element onto which tooltip is to be bound.
*/
Blockly.Tooltip.bindMouseEvents = function(element) {
Blockly.bindEventWithChecks_(element, 'mouseover', null,
Blockly.bindEvent_(element, 'mouseover', null,
Blockly.Tooltip.onMouseOver_);
Blockly.bindEventWithChecks_(element, 'mouseout', null,
Blockly.bindEvent_(element, 'mouseout', null,
Blockly.Tooltip.onMouseOut_);
// Don't use bindEvent_ for mousemove since that would create a