fix an issue where rendering the edit menu before updating layers would cause add annotation to fail
This commit is contained in:
parent
3407f36d12
commit
c36a3537c0
1 changed files with 6 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue