track own bindings

This commit is contained in:
spalger 2015-10-23 14:21:56 -05:00
parent bcd44d0c93
commit e0138a4614

View file

@ -3,6 +3,7 @@ define(function (require) {
var d3 = require('d3');
var $ = require('jquery');
var _ = require('lodash');
var Binder = require('ui/Binder');
/**
* Adds allerts that float in front of a visualization
@ -18,9 +19,10 @@ define(function (require) {
this.vis = vis;
this.data = data;
this.binder = new Binder();
this.alertDefs = alertDefs || [];
vis.binder.jqOn(vis.el, 'mouseenter', '.vis-alerts-tray', function () {
this.binder.jqOn(vis.el, 'mouseenter', '.vis-alerts-tray', function () {
var $tray = $(this);
hide();
$(vis.el).on('mousemove', checkForExit);
@ -87,6 +89,14 @@ define(function (require) {
);
};
/**
* Tear down the Alerts
* @return {undefined}
*/
Alerts.prototype.destroy = function () {
this.binder.destroy();
};
return Alerts;
};
});