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({ .bindEvent({
select: function(data) { select: function(data) {
if (!data.id || data.annotationIds.indexOf(self.options.selected) == -1) { if (!data.id && Ox.getObjectById(self.options.items, self.options.selected).event) {
self.$annotations.options({ // only deselect annotation if the event deselect was not
selected: !data.id ? '' : data.annotationIds[0] // 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({ .bindEvent({
// FIXME: should be select, not selectplace // FIXME: should be select, not selectplace
selectplace: function(data) { selectplace: function(data) {
if (!data.id || data.annotationIds.indexOf(self.options.selected) == -1) { if (!data.id && Ox.getObjectById(self.options.items, self.options.selected).place) {
self.$annotations.options({ // only deselect annotation if the place deselect was not
selected: !data.id ? '' : data.annotationIds[0] // 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) { function removeAnnotation(data) {
var item; var item;
Ox.print('REMOVE:::::::::', data)
self.editing = false; self.editing = false;
if (self.widget) { if (self.widget) {
item = Ox.getObjectById(self.options.items, data.id); 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); var index = Ox.getIndexById(self.options.items, item.id);
self.options.items[index] = item; self.options.items[index] = item;
updateAnnotations(); updateAnnotations();
Ox.print('updating.......', item[self.options.type])
if (self.widget && item[self.options.type]) { if (self.widget && item[self.options.type]) {
// if updating has made the item match // 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}); self.$widget.options({selected: item[self.options.type].id});
} }
return that; return that;