Added remove events for portals/links/fields.
This commit is contained in:
@ -28,6 +28,9 @@
|
|||||||
// the Leaflet CircleMarker for the portal in "portal" var.
|
// the Leaflet CircleMarker for the portal in "portal" var.
|
||||||
// linkAdded: called when a link is about to be added to the map
|
// linkAdded: called when a link is about to be added to the map
|
||||||
// fieldAdded: called when a field is about to be added to the map
|
// fieldAdded: called when a field is about to be added to the map
|
||||||
|
// portalRemoved: called when a portal has been removed
|
||||||
|
// linkRemoved: called when a link has been removed
|
||||||
|
// fieldRemoved: called when a field has been removed
|
||||||
// portalDetailsUpdated: fired after the details in the sidebar have
|
// portalDetailsUpdated: fired after the details in the sidebar have
|
||||||
// been (re-)rendered Provides data about the portal that
|
// been (re-)rendered Provides data about the portal that
|
||||||
// has been selected.
|
// has been selected.
|
||||||
@ -57,6 +60,7 @@ window.VALID_HOOKS = [
|
|||||||
'portalSelected', 'portalDetailsUpdated',
|
'portalSelected', 'portalDetailsUpdated',
|
||||||
'mapDataRefreshStart', 'mapDataRefreshEnd',
|
'mapDataRefreshStart', 'mapDataRefreshEnd',
|
||||||
'portalAdded', 'linkAdded', 'fieldAdded',
|
'portalAdded', 'linkAdded', 'fieldAdded',
|
||||||
|
'portalRemoved', 'linkRemoved', 'fieldRemoved',
|
||||||
'publicChatDataAvailable', 'factionChatDataAvailable',
|
'publicChatDataAvailable', 'factionChatDataAvailable',
|
||||||
'requestFinished', 'nicknameClicked',
|
'requestFinished', 'nicknameClicked',
|
||||||
'geoSearch', 'search', 'iitcLoaded',
|
'geoSearch', 'search', 'iitcLoaded',
|
||||||
|
@ -240,6 +240,7 @@ window.Render.prototype.deletePortalEntity = function(guid) {
|
|||||||
window.ornaments.removePortal(p);
|
window.ornaments.removePortal(p);
|
||||||
this.removePortalFromMapLayer(p);
|
this.removePortalFromMapLayer(p);
|
||||||
delete window.portals[guid];
|
delete window.portals[guid];
|
||||||
|
window.runHooks('portalRemoved', {portal: p, data: p.options.data });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,6 +249,7 @@ window.Render.prototype.deleteLinkEntity = function(guid) {
|
|||||||
var l = window.links[guid];
|
var l = window.links[guid];
|
||||||
linksFactionLayers[l.options.team].removeLayer(l);
|
linksFactionLayers[l.options.team].removeLayer(l);
|
||||||
delete window.links[guid];
|
delete window.links[guid];
|
||||||
|
window.runHooks('linkRemoved', {link: l, data: l.options.data });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,6 +261,7 @@ window.Render.prototype.deleteFieldEntity = function(guid) {
|
|||||||
|
|
||||||
fieldsFactionLayers[f.options.team].removeLayer(f);
|
fieldsFactionLayers[f.options.team].removeLayer(f);
|
||||||
delete window.fields[guid];
|
delete window.fields[guid];
|
||||||
|
window.runHooks('fieldRemoved', {field: f, data: f.options.data });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user