Merge pull request #3 from breunigs/gh-pages
Rebase from bruenigs/ingress-intel-total-conversion
This commit is contained in:
commit
caa3295a32
@ -30,11 +30,16 @@
|
|||||||
// yet been displayed. The data hash contains both the un-
|
// yet been displayed. The data hash contains both the un-
|
||||||
// processed raw ajax response as well as the processed
|
// processed raw ajax response as well as the processed
|
||||||
// chat data that is going to be used for display.
|
// chat data that is going to be used for display.
|
||||||
|
// portalDataLoaded: callback is passed the argument of
|
||||||
|
// {portals : [portal, portal, ...]} where "portal" is the
|
||||||
|
// data element and not the leaflet object. "portal" is an
|
||||||
|
// array [GUID, time, details]. Plugin can manipulate the
|
||||||
|
// array to change order or add additional values to the
|
||||||
|
// details of a portal.
|
||||||
|
|
||||||
window._hooks = {}
|
window._hooks = {}
|
||||||
window.VALID_HOOKS = ['portalAdded', 'portalDetailsUpdated',
|
window.VALID_HOOKS = ['portalAdded', 'portalDetailsUpdated',
|
||||||
'publicChatDataAvailable'];
|
'publicChatDataAvailable', 'portalDataLoaded'];
|
||||||
|
|
||||||
window.runHooks = function(event, data) {
|
window.runHooks = function(event, data) {
|
||||||
if(VALID_HOOKS.indexOf(event) === -1) throw('Unknown event type: ' + event);
|
if(VALID_HOOKS.indexOf(event) === -1) throw('Unknown event type: ' + event);
|
||||||
|
@ -127,6 +127,8 @@ window.handleDataResponse = function(data, textStatus, jqXHR) {
|
|||||||
|
|
||||||
// Preserve and restore "selectedPortal" between portal re-render
|
// Preserve and restore "selectedPortal" between portal re-render
|
||||||
if(portalUpdateAvailable) var oldSelectedPortal = selectedPortal;
|
if(portalUpdateAvailable) var oldSelectedPortal = selectedPortal;
|
||||||
|
|
||||||
|
runHooks('portalDataLoaded', {portals : ppp});
|
||||||
$.each(ppp, function(ind, portal) { renderPortal(portal); });
|
$.each(ppp, function(ind, portal) { renderPortal(portal); });
|
||||||
|
|
||||||
var selectedPortalLayer = portals[oldSelectedPortal];
|
var selectedPortalLayer = portals[oldSelectedPortal];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user