Pass entity type to autocompleteEntities, not layer id (fixes #2810)

If (for example) you have a type of entities, "participants", and a
second annotation layer for them, like this:

    {
        "id": "participantsdiscussed",
        "title": "Participants discussed",
        "type": "entity",
        "entity": "participants"
    }

then we should be passing key="participants" to autocompleteEntities
(since that is the type of entity), not key="participantsdiscussed"
(which is not a type of entities and raises an error).
This commit is contained in:
Will Thompson 2015-06-24 16:42:38 +02:00 committed by j
parent 9758b7d312
commit e55e503654

View file

@ -46,7 +46,7 @@ pandora.ui.editor = function(data) {
autocomplete: layer.type == 'entity'
? function(key, value, callback) {
pandora.api.autocompleteEntities({
key: key,
key: layer.entity,
operator: '=',
range: [0, 20],
value: value