update video editor (maps, calendars)

This commit is contained in:
rlx 2012-01-17 17:40:50 +05:30
parent 961f4f959a
commit 6d63c07ec5

View file

@ -127,10 +127,14 @@ Ox.AnnotationFolder = function(options, self) {
})
.bindEvent({
select: function(data) {
if (!data.id || data.annotationIds.indexOf(self.options.selected) == -1) {
self.$annotations.options({
selected: !data.id ? '' : data.annotationIds[0]
});
if (!data.id && Ox.getObjectById(self.options.items, self.options.selected).event) {
// only deselect annotation if the event deselect was not
// caused by switching to an annotation without event
self.$annotations.options({selected: ''});
} else if (data.annotationIds.indexOf(self.options.selected) == -1) {
// only select a new annotation if the currently selected
// annotation does not match the selected event
self.$annotations.options({selected: data.annotationIds[0]});
}
}
})
@ -150,10 +154,14 @@ Ox.AnnotationFolder = function(options, self) {
.bindEvent({
// FIXME: should be select, not selectplace
selectplace: function(data) {
if (!data.id || data.annotationIds.indexOf(self.options.selected) == -1) {
self.$annotations.options({
selected: !data.id ? '' : data.annotationIds[0]
});
if (!data.id && Ox.getObjectById(self.options.items, self.options.selected).place) {
// only deselect annotation if the place deselect was not
// caused by switching to an annotation without place
self.$annotations.options({selected: ''});
} else if (data.annotationIds.indexOf(self.options.selected) == -1) {
// only select a new annotation if the currently selected
// annotation does not match the selected place
self.$annotations.options({selected: data.annotationIds[0]});
}
}
})
@ -343,7 +351,6 @@ Ox.AnnotationFolder = function(options, self) {
function removeAnnotation(data) {
var item;
Ox.print('REMOVE:::::::::', data)
self.editing = false;
if (self.widget) {
item = Ox.getObjectById(self.options.items, data.id);
@ -524,10 +531,9 @@ Ox.AnnotationFolder = function(options, self) {
var index = Ox.getIndexById(self.options.items, item.id);
self.options.items[index] = item;
updateAnnotations();
Ox.print('updating.......', item[self.options.type])
if (self.widget && item[self.options.type]) {
// if updating has made the item match
// an event / a place, then select it
// an event or place, then select it
self.$widget.options({selected: item[self.options.type].id});
}
return that;