add portalDetailsUpdated hook

This commit is contained in:
Stefan Breunig 2013-02-16 13:43:37 +01:00
parent 9cb2722eb2
commit cd23248576
2 changed files with 5 additions and 1 deletions

View File

@ -22,9 +22,11 @@
// shown at all. Injection point is in
// code/map_data.js#renderPortal near the end. Will hand
// the Leaflet CircleMarker for the portal in "portal" var.
// portalDetailsUpdated: fired after the details in the sidebar have
// been (re-)rendered
window._hooks = {}
window.VALID_HOOKS = ['portalAdded'];
window.VALID_HOOKS = ['portalAdded', 'portalDetailsUpdated'];
window.runHooks = function(event, data) {
if(VALID_HOOKS.indexOf(event) === -1) throw('Unknown event type: ' + event);

View File

@ -70,6 +70,8 @@ window.renderPortalDetails = function(guid) {
// try to resolve names that were required for above functions, but
// werent available yet.
resolvePlayerNames();
runHooks('portalDetailsUpdated', {});
}
// draws link-range and hack-range circles around the portal with the