check defined

This commit is contained in:
j 2012-02-01 16:36:18 +00:00
parent 72323febea
commit 8bab6a9c0c

View file

@ -335,7 +335,7 @@ Ox.AnnotationFolder = function(options, self) {
function getEvents() {
var events = [];
self.annotations.filter(function(item) {
return !!item.event;
return !!(item.event && item.event.defined);
}).forEach(function(item) {
var index = Ox.getIndexById(events, item.event.id);
if (index == -1) {
@ -352,7 +352,7 @@ Ox.AnnotationFolder = function(options, self) {
function getPlaces() {
var places = [];
self.annotations.filter(function(item) {
return !!item.place;
return !!(item.place && item.place.defined);
}).forEach(function(item) {
var index = Ox.getIndexById(places, item.place.id);
if (index == -1) {
@ -423,9 +423,9 @@ Ox.AnnotationFolder = function(options, self) {
// which is an EditableElement without .data('id')
if (
$element.data('id')
&& !Ox.getObjectById(
&& !(Ox.getObjectById(
self.options.items, $element.data('id')
)[self.options.type]
)[self.options.type] || {}).defined
) {
$element.addClass('OxWarning');
}