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