Merge pull request #1064 from ssergni-smith/artifact-hooks
Add hook for artifact details being updated
This commit is contained in:
@ -70,9 +70,11 @@ window.artifact.processData = function(data) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var oldArtifacts = artifact.entities;
|
||||||
artifact.clearData();
|
artifact.clearData();
|
||||||
|
|
||||||
artifact.processResult(data.result);
|
artifact.processResult(data.result);
|
||||||
|
runHooks('artifactsUpdated', {old: oldArtifacts, 'new': artifact.entities});
|
||||||
|
|
||||||
// redraw the artifact layer
|
// redraw the artifact layer
|
||||||
artifact.updateLayer();
|
artifact.updateLayer();
|
||||||
|
@ -52,10 +52,12 @@
|
|||||||
// this only selects the current chat pane; on mobile, it
|
// this only selects the current chat pane; on mobile, it
|
||||||
// also switches between map, info and other panes defined
|
// also switches between map, info and other panes defined
|
||||||
// by plugins
|
// by plugins
|
||||||
|
// artifactsUpdated: called when the set of artifacts (including targets)
|
||||||
|
// has changed. Parameters names are old, new.
|
||||||
|
|
||||||
window._hooks = {}
|
window._hooks = {}
|
||||||
window.VALID_HOOKS = [
|
window.VALID_HOOKS = [
|
||||||
'portalSelected', 'portalDetailsUpdated',
|
'portalSelected', 'portalDetailsUpdated', 'artifactsUpdated',
|
||||||
'mapDataRefreshStart', 'mapDataEntityInject', 'mapDataRefreshEnd',
|
'mapDataRefreshStart', 'mapDataEntityInject', 'mapDataRefreshEnd',
|
||||||
'portalAdded', 'linkAdded', 'fieldAdded',
|
'portalAdded', 'linkAdded', 'fieldAdded',
|
||||||
'publicChatDataAvailable', 'factionChatDataAvailable',
|
'publicChatDataAvailable', 'factionChatDataAvailable',
|
||||||
|
Reference in New Issue
Block a user