diff --git a/code/hooks.js b/code/hooks.js index f5b90d0b..d980c626 100644 --- a/code/hooks.js +++ b/code/hooks.js @@ -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); diff --git a/code/portal_detail_display.js b/code/portal_detail_display.js index 8f0b1f49..3f5d6ac5 100644 --- a/code/portal_detail_display.js +++ b/code/portal_detail_display.js @@ -70,6 +70,8 @@ window.renderPortalDetails = function(guid) { // try to resolve names that were required for above functions, but // weren’t available yet. resolvePlayerNames(); + + runHooks('portalDetailsUpdated', {}); } // draws link-range and hack-range circles around the portal with the