Commit c62eb786 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

new popups require destroy

parent d9cddf0e
......@@ -51,28 +51,47 @@ function AbstractCustomMap(model, options) {
this.setModel(model);
// this array contains elements that are presented on a specific overlay (set
// of google map object representing lines/areas that are associated with
// overlay)
// @type {Array<AbstractSurface[]>}
/**
* this array contains elements that are presented on a specific overlay (set
* of google map object representing lines/areas that are associated with
* overlay)
* @type {Array<AbstractSurface[]>}
*/
this.selectedLayoutOverlays = [];
// array with info windows for Marker pointing to aliases
// @type {AliasInfoWindow[]}
/**
*
* @type {AliasInfoWindow[]}
* @private
*/
this._aliasInfoWindow = [];
// array with info windows for Marker pointing to points
// @type {PointInfoWindow[]}
/**
*
* @type {PointInfoWindow[]}
* @private
*/
this._pointInfoWindow = [];
// array with info windows for reactions
// @type {ReactionInfoWindow[]}
/**
*
* @type {ReactionInfoWindow[]}
* @private
*/
this._reactionInfoWindow = [];
// @type {MarkerSurfaceCollection}
/**
*
* @type {MarkerSurfaceCollection}
* @private
*/
this._markerSurfaceCollection = new MarkerSurfaceCollection({map: this});
// @type {boolean}
/**
*
* @type {boolean}
* @private
*/
this._bigLogo = options.isBigLogo();
this.setDebug(options.isDebug());
......@@ -1036,7 +1055,25 @@ AbstractCustomMap.prototype.getServerConnector = function () {
};
AbstractCustomMap.prototype.destroy = function () {
var self = this;
$(this.getElement()).off("touchstart");
var key;
for (key in self._aliasInfoWindow) {
if (self._aliasInfoWindow.hasOwnProperty(key)) {
self._aliasInfoWindow[key].destroy();
}
}
for (key in self._pointInfoWindow) {
if (self._pointInfoWindow.hasOwnProperty(key)) {
self._pointInfoWindow[key].destroy();
}
}
for (key in self._reactionInfoWindow) {
if (self._reactionInfoWindow.hasOwnProperty(key)) {
self._reactionInfoWindow[key].destroy();
}
}
};
/**
......
......@@ -561,6 +561,7 @@ AliasInfoWindow.prototype.getAlias = function () {
*
*/
AliasInfoWindow.prototype.destroy = function () {
AbstractInfoWindow.prototype.destroy.call(this);
if (this.pileup !== undefined) {
this.pileup.destroy();
}
......
......@@ -77,6 +77,8 @@ describe('DrugDbOverlay', function () {
}).then(function (elements) {
assert.ok(infoWindow.getContent().innerHTML.indexOf("NADH") >= 0);
assert.equal(elements.length, 1);
}).finally(function(){
return map.destroy();
});
});
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment