remove .bind method from IconGroup

This commit is contained in:
Mariela Michalek 2014-08-03 19:09:25 -03:00
parent 78e05e6aaf
commit b550f7892e

View File

@ -166,13 +166,15 @@ mindplot.IconGroup.RemoveTip = new Class({
icon.remove(); icon.remove();
}); });
var me = this;
widget.addEvent('mouseover', function () { widget.addEvent('mouseover', function () {
this.show(topicId, icon); me.show(topicId, icon);
}.bind(this)); });
widget.addEvent('mouseout', function () { widget.addEvent('mouseout', function () {
this.hide(); me.hide();
}.bind(this)); });
widget.setPosition(pos.x + 80, pos.y - 50); widget.setPosition(pos.x + 80, pos.y - 50);
this._fadeElem.append(widget); this._fadeElem.append(widget);
@ -197,17 +199,15 @@ mindplot.IconGroup.RemoveTip = new Class({
clearTimeout(this._closeTimeoutId) clearTimeout(this._closeTimeoutId)
} }
var me = this;
if (this._activeIcon) { if (this._activeIcon) {
var widget = this._widget; var widget = this._widget;
var close = function () { var close = function () {
me._activeIcon = null;
this._activeIcon = null; me._fadeElem.removeChild(widget);
this._fadeElem.removeChild(widget); me._widget = null;
this._widget = null; me._closeTimeoutId = null;
};
this._closeTimeoutId = null;
}.bind(this);
if (!$defined(delay) || delay == 0) { if (!$defined(delay) || delay == 0) {
close(); close();
@ -273,14 +273,16 @@ mindplot.IconGroup.RemoveTip = new Class({
decorate:function (topicId, icon) { decorate:function (topicId, icon) {
var me = this;
if (!icon.__remove) { if (!icon.__remove) {
icon.addEvent('mouseover', function () { icon.addEvent('mouseover', function () {
this.show(topicId, icon); me.show(topicId, icon);
}.bind(this)); });
icon.addEvent('mouseout', function () { icon.addEvent('mouseout', function () {
this.hide(); me.hide();
}.bind(this)); });
icon.__remove = true; icon.__remove = true;
} }
} }