1
0
Fork 0
forked from 0x2620/oxjs

use Ox.break

This commit is contained in:
rolux 2012-05-22 09:11:26 +02:00
commit 04784630d3
42 changed files with 117 additions and 118 deletions

View file

@ -396,7 +396,7 @@ Ox.Filter = function(options, self) {
Ox.forEach(self.options.query.conditions, function(condition) {
if (condition.conditions) {
hasGroups = true;
return false;
Ox.break();
}
});
hasGroups && renderConditions();
@ -426,7 +426,9 @@ Ox.Filter = function(options, self) {
self.options.query.operator == '&' ? ['', '^', '$'] : ['!', '!^', '!$']
).indexOf(condition.operator) > -1
&& condition.value === ''
return isUseless;
// FIXME: this used to be `return isUseless` - but was it intended
// to be the other way around, i.e. `isUseless && Ox.break`?
!isUseless && Ox.break();
});
Ox.Log('Form', 'isUseless', isUseless);
return isUseless;

View file

@ -100,7 +100,7 @@ Ox.Form = function(options, self) {
}
function submitCallback(data) {
Ox.forEach(data, function(v, i) {
Ox.forEach(data, function(v) {
self.$items[getItemIndexById(v.id)].setMessage(v.message);
});
}
@ -188,7 +188,6 @@ Ox.Form = function(options, self) {
Ox.Log('Form', 'SET FORM VALUES', arguments[0])
Ox.forEach(arguments[0], function(value, key) {
var index = getItemIndexById(key);
index > -1 && Ox.Log('Form', ':::::::', key, value)
index > -1 && self.options.items[index].value(value);
});
return that;

View file

@ -65,7 +65,7 @@ Ox.FormPanel = function(options, self) {
Ox.forEach(self.options.form, function(section, i) {
if (section.title == data.ids[0]) {
self.section = i;
return false;
Ox.break();
}
});
self.$sections[self.section].show();
@ -147,7 +147,7 @@ Ox.FormPanel = function(options, self) {
Ox.forEach(self.options.form, function(section, i) {
if (section.title == title) {
index = i;
return false;
Ox.break();
}
});
return index;

View file

@ -90,7 +90,7 @@ Ox.InputGroup = function(options, self) {
Ox.forEach(self.options.inputs, function($input) {
if ($input.focusInput) {
$input.focusInput(true);
return false;
Ox.break();
}
});
}
@ -135,7 +135,6 @@ Ox.InputGroup = function(options, self) {
}
function validate(data) {
//Ox.Log('Form', 'INPUTGROUP TRIGGER VALIDATE')
that.triggerEvent('validate', data);
}
@ -152,7 +151,7 @@ Ox.InputGroup = function(options, self) {
//Ox.Log('Form', v, v.options('id'), id)
if (v.options('id') == self.options.id + Ox.toTitleCase(id)) {
input = v;
return false;
Ox.break();
}
});
return input;

View file

@ -26,7 +26,7 @@ Ox.OptionGroup = function(items, min, max, property) {
), function(v) {
if (items[v][property]) {
last = v;
return false;
Ox.break();
}
});
return last;