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
|
|
@ -82,7 +82,7 @@ Ox.ArrayEditable = function(options, self) {
|
|||
}
|
||||
|
||||
function getSelectedPosition() {
|
||||
return Ox.getPositionById(self.options.items, self.options.selected);
|
||||
return Ox.getIndexById(self.options.items, self.options.selected);
|
||||
}
|
||||
|
||||
function renderItems() {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ Ox.Filter = function(options, self) {
|
|||
Ox.Log('Form', 'old new', oldConditionType, newConditionType)
|
||||
condition.key = key;
|
||||
if (changeConditionType || changeConditionFormat) {
|
||||
if (Ox.getPositionById(self.conditionOperators[newConditionType], condition.operator) == -1) {
|
||||
if (Ox.getIndexById(self.conditionOperators[newConditionType], condition.operator) == -1) {
|
||||
condition.operator = self.conditionOperators[newConditionType][0].id;
|
||||
}
|
||||
if (
|
||||
|
|
|
|||
|
|
@ -164,7 +164,6 @@ Ox.Form = function(options, self) {
|
|||
var values = {};
|
||||
if (arguments.length == 0) {
|
||||
self.$items.forEach(function($item, i) {
|
||||
//Ox.print('??????-??', self.itemIds[i], self.$items[i].value(), Ox.typeOf(self.$items[i].value()))
|
||||
values[self.itemIds[i]] = self.$items[i].value();
|
||||
});
|
||||
//Ox.Log('Form', 'VALUES', values)
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ Ox.FormPanel = function(options, self) {
|
|||
});
|
||||
|
||||
self.$forms.forEach(function($form, i) {
|
||||
Ox.print(self.sections[i], 'valid', $form.valid());
|
||||
//Ox.print(self.sections[i], 'valid', $form.valid());
|
||||
self.$list.value(self.sections[i], 'valid', $form.valid());
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ Ox.ObjectArrayInput = function(options, self) {
|
|||
setValue(self.options.value);
|
||||
|
||||
function addInput(index, value) {
|
||||
Ox.print('ADD INPUT', index, value)
|
||||
self.$element.splice(index, 0, Ox.Element()
|
||||
.css({
|
||||
width: self.options.width + 'px',
|
||||
|
|
|
|||
|
|
@ -81,7 +81,6 @@ Ox.SelectInput = function(options, self) {
|
|||
}
|
||||
|
||||
function setValue(isOther) {
|
||||
Ox.print('SET VALUE', isOther)
|
||||
if (
|
||||
(!self.options.value && isOther !== true)
|
||||
|| Ox.map(self.options.items, function(item) {
|
||||
|
|
@ -120,7 +119,6 @@ Ox.SelectInput = function(options, self) {
|
|||
return getValue();
|
||||
} else {
|
||||
self.options.value = arguments[0];
|
||||
Ox.print('SOV:::', self.options.value)
|
||||
setValue();
|
||||
return that;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue