forked from 0x2620/oxjs
remove Ox.each, , $.extend, $.map and $.merge
This commit is contained in:
parent
da9e5dbb29
commit
4cc754a28d
35 changed files with 104 additions and 131 deletions
|
|
@ -34,18 +34,18 @@ Ox.CheckboxGroup = function(options, self) {
|
|||
self.options.max);
|
||||
self.options.checkboxes = self.optionGroup.init();
|
||||
|
||||
$.extend(self, {
|
||||
Ox.extend(self, {
|
||||
$checkboxes: [],
|
||||
checkboxWidth: $.map(Ox.divideInt(
|
||||
checkboxWidth: Ox.divideInt(
|
||||
self.options.width + (self.options.checkboxes.length - 1) * 6,
|
||||
self.options.checkboxes.length
|
||||
), function(v, i) {
|
||||
).map(function(v, i) {
|
||||
return v + (i < self.options.checkboxes.length - 1 ? 10 : 0);
|
||||
})
|
||||
});
|
||||
self.options.checkboxes.forEach(function(checkbox, position) {
|
||||
var id = self.options.id + Ox.toTitleCase(checkbox.id)
|
||||
self.$checkboxes[position] = Ox.Checkbox($.extend(checkbox, {
|
||||
self.$checkboxes[position] = Ox.Checkbox(Ox.extend(checkbox, {
|
||||
group: true,
|
||||
id: id,
|
||||
width: self.checkboxWidth[position]
|
||||
|
|
@ -64,7 +64,7 @@ Ox.CheckboxGroup = function(options, self) {
|
|||
self.$checkboxes[pos].toggleChecked();
|
||||
});
|
||||
that.triggerEvent('change', {
|
||||
checked: $.map(self.optionGroup.checked(), function(v, i) {
|
||||
checked: self.optionGroup.checked().map(function(v) {
|
||||
return self.options.checkboxes[v].id;
|
||||
})
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue