1
0
Fork 0
forked from 0x2620/oxjs

- find in layers

- change upadteAnnotation call to allow id updates
This commit is contained in:
j 2012-01-31 10:57:09 +00:00
commit fd96423266
6 changed files with 81 additions and 38 deletions

View file

@ -13,6 +13,7 @@ Ox.AnnotationPanel = function(options, self) {
clickLink: null,
editable: false,
font: 'small',
highlight: null,
layers: [],
mapSize: 256,
range: 'all',
@ -154,6 +155,7 @@ Ox.AnnotationPanel = function(options, self) {
collapsed: !self.options.showLayers[layer.id],
editable: self.options.editable,
font: self.options.font,
highlight: self.options.highlight,
'in': self.options['in'],
out: self.options.out,
position: self.options.position,
@ -308,7 +310,11 @@ Ox.AnnotationPanel = function(options, self) {
}
self.setOption = function(key, value) {
if (['in', 'out', 'position'].indexOf(key) > -1) {
if (key == 'highlight') {
self.$folder.forEach(function($folder) {
$folder.options({highlight: value});
});
} else if (['in', 'out', 'position'].indexOf(key) > -1) {
self.$folder.forEach(function($folder) {
$folder.options(key, value);
});
@ -329,7 +335,7 @@ Ox.AnnotationPanel = function(options, self) {
};
that.addItem = function(layer, item) {
Ox.print('ADD ITEM', layer, item);
Ox.Log('AP', 'ADD ITEM', layer, item);
var i = Ox.getIndexById(self.options.layers, layer);
self.$folder[i].addItem(item);
};
@ -342,9 +348,10 @@ Ox.AnnotationPanel = function(options, self) {
getFolder(self.options.selected).editItem();
};
that.updateItem = function(item) {
Ox.print('UPDATE ITEM', item);
getFolder(item.id).updateItem(item);
that.updateItem = function(id, item) {
Ox.Log('AP', 'UPDATE ITEM', id, item);
self.options.selected = item.id;
getFolder(id).updateItem(id, item);
};
return that;