From 8bab6a9c0c90b3ddceac27a0b02f29c4b80f32f9 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 1 Feb 2012 16:36:18 +0000 Subject: [PATCH] check defined --- source/Ox.UI/js/Video/Ox.AnnotationFolder.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/Ox.UI/js/Video/Ox.AnnotationFolder.js b/source/Ox.UI/js/Video/Ox.AnnotationFolder.js index 179ea0a9..b94c3b5c 100644 --- a/source/Ox.UI/js/Video/Ox.AnnotationFolder.js +++ b/source/Ox.UI/js/Video/Ox.AnnotationFolder.js @@ -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'); }