forked from 0x2620/oxjs
Ox.getPositionById() -> Ox.getIndexById()
This commit is contained in:
parent
4ca01b2bfa
commit
8097cc7812
19 changed files with 23 additions and 30 deletions
|
|
@ -142,7 +142,7 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
open: function(data) {
|
||||
return;
|
||||
if (data.ids.length == 1) {
|
||||
var pos = Ox.getPositionById(self.$annotations.options('items'), data.ids[0]);
|
||||
var pos = Ox.getIndexById(self.$annotations.options('items'), data.ids[0]);
|
||||
self.$annotations.editItem(pos);
|
||||
}
|
||||
},
|
||||
|
|
@ -194,7 +194,6 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
}
|
||||
|
||||
function updateAnnotation(data) {
|
||||
Ox.print('updateAnnotation', data);
|
||||
var item = Ox.getObjectById(self.options.items, data.id);
|
||||
item.value = data.value;
|
||||
that.triggerEvent('submit', item);
|
||||
|
|
@ -251,7 +250,7 @@ Ox.AnnotationPanel = function(options, self) {
|
|||
removeItems <f> removeItems
|
||||
@*/
|
||||
that.removeItem = function(id) {
|
||||
var pos = Ox.getPositionById(self.options.items, id);
|
||||
var pos = Ox.getIndexById(self.options.items, id);
|
||||
self.options.items.splice(pos, 1);
|
||||
self.$annotations.removeItems && self.$annotations.removeItems([id]);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue