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
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue