From c36a3537c03e8dfbf4cadbae1394e3f079edaa6d Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Fri, 17 Feb 2012 12:18:26 +0000 Subject: [PATCH] fix an issue where rendering the edit menu before updating layers would cause add annotation to fail --- source/Ox.UI/js/Video/Ox.AnnotationPanel.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/Ox.UI/js/Video/Ox.AnnotationPanel.js b/source/Ox.UI/js/Video/Ox.AnnotationPanel.js index 7a7c49f5..b742aa0e 100644 --- a/source/Ox.UI/js/Video/Ox.AnnotationPanel.js +++ b/source/Ox.UI/js/Video/Ox.AnnotationPanel.js @@ -278,6 +278,7 @@ Ox.AnnotationPanel = function(options, self) { if (self.options.selected) { annotation = getAnnotation(self.options.selected); folder = getFolder(self.options.selected); + Ox.print('>>>>?', annotation, folder, self.options.selected); key = folder.options('id'); type = folder.options('type'); value = annotation.value; @@ -454,27 +455,28 @@ Ox.AnnotationPanel = function(options, self) { that.addItem = function(layer, item) { // called from addannotation callback var i = Ox.getIndexById(self.options.layers, layer); - renderEditMenu(); self.$folder[i].addItem(item); + renderEditMenu(); }; that.blurItem = function() { self.editing = false; - renderEditMenu(); getFolder(self.options.selected).blurItem(); + renderEditMenu(); }; that.editItem = function() { self.editing = true; - renderEditMenu(); getFolder(self.options.selected).editItem(); + renderEditMenu(); }; that.updateItem = function(id, item) { // called from editannotation callback + // on the first update of a new annotation, the id will change self.options.selected = item.id; - renderEditMenu(); getFolder(id).updateItem(id, item); + renderEditMenu(); }; return that;