From b550f7892e5ea138f494fce79167f9882f3a164a Mon Sep 17 00:00:00 2001 From: Mariela Michalek Date: Sun, 3 Aug 2014 19:09:25 -0300 Subject: [PATCH] remove .bind method from IconGroup --- mindplot/src/main/javascript/IconGroup.js | 34 ++++++++++++----------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/mindplot/src/main/javascript/IconGroup.js b/mindplot/src/main/javascript/IconGroup.js index 8f5a5a49..0a2dfef8 100644 --- a/mindplot/src/main/javascript/IconGroup.js +++ b/mindplot/src/main/javascript/IconGroup.js @@ -166,13 +166,15 @@ mindplot.IconGroup.RemoveTip = new Class({ icon.remove(); }); + var me = this; + widget.addEvent('mouseover', function () { - this.show(topicId, icon); - }.bind(this)); + me.show(topicId, icon); + }); widget.addEvent('mouseout', function () { - this.hide(); - }.bind(this)); + me.hide(); + }); widget.setPosition(pos.x + 80, pos.y - 50); this._fadeElem.append(widget); @@ -197,17 +199,15 @@ mindplot.IconGroup.RemoveTip = new Class({ clearTimeout(this._closeTimeoutId) } + var me = this; if (this._activeIcon) { var widget = this._widget; var close = function () { - - this._activeIcon = null; - this._fadeElem.removeChild(widget); - this._widget = null; - - this._closeTimeoutId = null; - - }.bind(this); + me._activeIcon = null; + me._fadeElem.removeChild(widget); + me._widget = null; + me._closeTimeoutId = null; + }; if (!$defined(delay) || delay == 0) { close(); @@ -273,14 +273,16 @@ mindplot.IconGroup.RemoveTip = new Class({ decorate:function (topicId, icon) { + var me = this; + if (!icon.__remove) { icon.addEvent('mouseover', function () { - this.show(topicId, icon); - }.bind(this)); + me.show(topicId, icon); + }); icon.addEvent('mouseout', function () { - this.hide(); - }.bind(this)); + me.hide(); + }); icon.__remove = true; } }