Clean up code.

This commit is contained in:
Jürg Lehni 2012-11-14 10:02:07 -08:00
parent 550d43ae0b
commit 926e5d0b3a
2 changed files with 7 additions and 7 deletions

View file

@ -52,9 +52,9 @@ var DomElement = new function() {
}
return {
create: function(arg0, arg1) {
var isArray = Array.isArray(arg0),
res = create(isArray ? arg0 : arguments, isArray ? arg1 : null);
create: function(nodes, parent) {
var isArray = Array.isArray(nodes),
res = create(isArray ? nodes : arguments, isArray ? parent : null);
return res.length == 1 ? res[0] : res;
},

View file

@ -46,6 +46,7 @@ var Component = this.Component = Base.extend(Callback, /** @lends Component# */{
list: {
tag: 'select',
options: function() {
DomElement.removeChildren(this.element);
DomElement.create(Base.each(this._options, function(option) {
@ -129,10 +130,9 @@ var Component = this.Component = Base.extend(Callback, /** @lends Component# */{
toFloat(DomElement.get(this.element, 'max'))];
},
setRange: function(arg0, arg1) {
if (!Array.isArray(arg0))
arg0 = [arg0, arg1];
DomElement.set(this.element, { min: arg0[0], max: arg0[1] });
setRange: function(min, max) {
var range = Array.isArray(min) ? min : [min, max];
DomElement.set(this.element, { min: range[0], max: range[1] });
},
getMin: function() {