forked from 0x2620/pandora
fix default value annotations
This commit is contained in:
parent
0da8a9b0ec
commit
46fb46bf26
1 changed files with 30 additions and 19 deletions
|
@ -117,25 +117,36 @@ 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({
|
||||||
created: created,
|
'in': data['in'],
|
||||||
duration: data.out - data['in'],
|
item: ui.item,
|
||||||
editable: true,
|
layer: data.layer,
|
||||||
id: '_' + Ox.uid(),
|
out: data.out
|
||||||
'in': data['in'],
|
},
|
||||||
modified: created,
|
pandora[layer.getDefaults](data)
|
||||||
out: data.out,
|
), function(result) {
|
||||||
user: pandora.user.username,
|
that.addAnnotation(data.layer, result.data)
|
||||||
value: ''
|
})
|
||||||
},
|
} else {
|
||||||
type == 'place' ? {
|
that.addAnnotation(data.layer, Ox.extend({
|
||||||
place: {lat: null, lng: null}
|
created: created,
|
||||||
} : type == 'event' ? {
|
duration: data.out - data['in'],
|
||||||
event: {start: '', end: ''}
|
editable: true,
|
||||||
} : {},
|
id: '_' + Ox.uid(),
|
||||||
layer.getDefaults ? pandora[layer.getDefaults](data) : {}
|
'in': data['in'],
|
||||||
));
|
modified: created,
|
||||||
|
out: data.out,
|
||||||
|
user: pandora.user.username,
|
||||||
|
value: ''
|
||||||
|
},
|
||||||
|
type == 'place' ? {
|
||||||
|
place: {lat: null, lng: null}
|
||||||
|
} : type == 'event' ? {
|
||||||
|
event: {start: '', end: ''}
|
||||||
|
} : {},
|
||||||
|
));
|
||||||
|
}
|
||||||
Ox.Request.clearCache();
|
Ox.Request.clearCache();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue