fix default value annotations

This commit is contained in:
j 2019-03-12 13:44:57 +00:00
parent 0da8a9b0ec
commit 46fb46bf26

View file

@ -117,8 +117,19 @@ pandora.ui.editor = function(data) {
var created = Ox.formatDate(new Date(), '%Y-%m-%dT%H:%M:%SZ'), var created = Ox.formatDate(new Date(), '%Y-%m-%dT%H:%M:%SZ'),
layer = Ox.getObjectById(pandora.site.layers, data.layer), layer = Ox.getObjectById(pandora.site.layers, data.layer),
type = layer.type; type = layer.type;
that.addAnnotation(data.layer, Ox.extend( if (layer.getDefaults) {
{ pandora.api.addAnnotation(Ox.extend({
'in': data['in'],
item: ui.item,
layer: data.layer,
out: data.out
},
pandora[layer.getDefaults](data)
), function(result) {
that.addAnnotation(data.layer, result.data)
})
} else {
that.addAnnotation(data.layer, Ox.extend({
created: created, created: created,
duration: data.out - data['in'], duration: data.out - data['in'],
editable: true, editable: true,
@ -134,8 +145,8 @@ pandora.ui.editor = function(data) {
} : type == 'event' ? { } : type == 'event' ? {
event: {start: '', end: ''} event: {start: '', end: ''}
} : {}, } : {},
layer.getDefaults ? pandora[layer.getDefaults](data) : {}
)); ));
}
Ox.Request.clearCache(); Ox.Request.clearCache();
}); });
}, },