Commit 7c917694 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

second call on remove all listeners doesn't show a warning

parent 0d2036e6
Pipeline #8995 passed with stage
in 9 minutes and 19 seconds
minerva (12.2.0~beta.2) unstable; urgency=medium
* Bug fix: when removeAllListeners is called list of registered listeners is
cleaned (#687)
* Bug fix: when plugin is removed the html elements associated with it are
removed as well (#686)
* Bug fix: when creating new user default privileges are set properly (#692)
......
......@@ -535,6 +535,7 @@ function createProjectMap(options) {
listenerData.object.removeListener(listenerData.type, listenerWrapper);
removedListeners.push(listenerData.listener);
}
listenersData = [];
return removedListeners;
},
getHighlightedBioEntities: function (dbOverlayName) {
......
......@@ -80,7 +80,7 @@ Plugin.prototype.getLoadedPluginData = function () {
/**
*
* @param minervaPluginProxy
* @param {MinervaPluginProxy} minervaPluginProxy
*/
Plugin.prototype.setMinervaPluginProxy = function (minervaPluginProxy) {
this._minervaPluginProxy = minervaPluginProxy;
......@@ -88,7 +88,7 @@ Plugin.prototype.setMinervaPluginProxy = function (minervaPluginProxy) {
/**
*
* @returns {*}
* @returns {MinervaPluginProxy}
*/
Plugin.prototype.getMinervaPluginProxy = function () {
return this._minervaPluginProxy;
......
......@@ -166,6 +166,23 @@ describe('MinervaPluginProxy', function () {
return map.destroy();
});
});
it('call twice', function () {
var map = helper.createCustomMap();
var proxy = createProxy(map);
var options = {
object: "map",
type: "onZoomChanged",
callback: function () {
}
};
proxy.project.map.addListener(options);
var removedListeners = proxy.project.map.removeAllListeners();
assert.equal(1, removedListeners.length);
removedListeners = proxy.project.map.removeAllListeners();
assert.equal(0, removedListeners.length);
return map.destroy();
});
it('no listeners', function () {
var map;
return ServerConnector.getProject().then(function (project) {
......@@ -688,8 +705,8 @@ describe('MinervaPluginProxy', function () {
helper.createSearchDbOverlay(map);
proxy = createProxy(map);
var overlays = proxy.project.data.getDataOverlays();
assert.ok(overlays.length>0);
for (var i=0;i<overlays.length;i++) {
assert.ok(overlays.length > 0);
for (var i = 0; i < overlays.length; i++) {
assert.ok(overlays[i].getInputDataAvailable());
}
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