1
0
Fork 0
forked from 0x2620/oxjs

swap the meaning of makeArray and toArray: makeArray, like makeObject, is a helper function for arguments processing (that wraps any non-array in an array), toArray, like in other libraries, is an alias for Array.prototype.slice.call

This commit is contained in:
rolux 2012-05-19 12:40:59 +04:00
commit 5692195509
21 changed files with 88 additions and 88 deletions

View file

@ -53,7 +53,7 @@ Ox.App = function(options) {
},
navigator: {
cookieEnabled: navigator.cookieEnabled,
plugins: Ox.makeArray(navigator.plugins).map(function(plugin) {
plugins: Ox.toArray(navigator.plugins).map(function(plugin) {
return plugin.name;
}),
userAgent: navigator.userAgent

View file

@ -430,7 +430,7 @@ Ox.Element = function(options, self) {
@*/
that.toggleOption = function() {
var options = {};
Ox.toArray(arguments[0]).forEach(function(key) {
Ox.makeArray(arguments[0]).forEach(function(key) {
options[key] == !self.options[key];
});
that.options(options);
@ -483,7 +483,7 @@ Ox.Element = function(options, self) {
if (arguments.length == 0) {
self.$eventHandler.unbind();
} else {
Ox.makeArray(arguments).forEach(function(event) {
Ox.toArray(arguments).forEach(function(event) {
self.$eventHandler.unbind('ox_' + event);
});
}

View file

@ -84,7 +84,7 @@ Ox.Event = (function() {
if (arguments.length == 0) {
self.$eventHandler.unbind();
} else {
Ox.makeArray(arguments).forEach(function(event) {
Ox.toArray(arguments).forEach(function(event) {
self.$eventHandler.unbind('ox_' + event);
});
}