1
0
Fork 0
forked from 0x2620/oxjs

Ox.getPositionById() -> Ox.getIndexById()

This commit is contained in:
rolux 2012-01-04 13:41:05 +05:30
commit 8097cc7812
19 changed files with 23 additions and 30 deletions

View file

@ -74,7 +74,7 @@ Ox.Button = function(options, self) {
title: value.title || value
};
});
self.value = Ox.getPositionById(self.options.values, self.options.value);
self.value = Ox.getIndexById(self.options.values, self.options.value);
if (self.value == -1) {
self.value = 0;
self.options.value = self.options.values[0].id;
@ -144,8 +144,7 @@ Ox.Button = function(options, self) {
that.toggle = function() {
if (self.options.values.length) {
self.value = 1 - Ox.getPositionById(self.options.values, self.options.value);
Ox.print('S:O:', self.options, self.value)
self.value = 1 - Ox.getIndexById(self.options.values, self.options.value);
self.options.title = self.options.values[self.value].title;
self.options.value = self.options.values[self.value].id;
setTitle();