From 926e5d0b3ae9a644e9e859a219b5363a55c288b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 14 Nov 2012 10:02:07 -0800 Subject: [PATCH] Clean up code. --- src/browser/DomElement.js | 6 +++--- src/ui/Component.js | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/browser/DomElement.js b/src/browser/DomElement.js index ef3c46c8..f8d31216 100644 --- a/src/browser/DomElement.js +++ b/src/browser/DomElement.js @@ -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; }, diff --git a/src/ui/Component.js b/src/ui/Component.js index 49c314a1..fd26f342 100644 --- a/src/ui/Component.js +++ b/src/ui/Component.js @@ -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() {