mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Clean up code.
This commit is contained in:
parent
550d43ae0b
commit
926e5d0b3a
2 changed files with 7 additions and 7 deletions
|
@ -52,9 +52,9 @@ var DomElement = new function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
create: function(arg0, arg1) {
|
create: function(nodes, parent) {
|
||||||
var isArray = Array.isArray(arg0),
|
var isArray = Array.isArray(nodes),
|
||||||
res = create(isArray ? arg0 : arguments, isArray ? arg1 : null);
|
res = create(isArray ? nodes : arguments, isArray ? parent : null);
|
||||||
return res.length == 1 ? res[0] : res;
|
return res.length == 1 ? res[0] : res;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ var Component = this.Component = Base.extend(Callback, /** @lends Component# */{
|
||||||
|
|
||||||
list: {
|
list: {
|
||||||
tag: 'select',
|
tag: 'select',
|
||||||
|
|
||||||
options: function() {
|
options: function() {
|
||||||
DomElement.removeChildren(this.element);
|
DomElement.removeChildren(this.element);
|
||||||
DomElement.create(Base.each(this._options, function(option) {
|
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'))];
|
toFloat(DomElement.get(this.element, 'max'))];
|
||||||
},
|
},
|
||||||
|
|
||||||
setRange: function(arg0, arg1) {
|
setRange: function(min, max) {
|
||||||
if (!Array.isArray(arg0))
|
var range = Array.isArray(min) ? min : [min, max];
|
||||||
arg0 = [arg0, arg1];
|
DomElement.set(this.element, { min: range[0], max: range[1] });
|
||||||
DomElement.set(this.element, { min: arg0[0], max: arg0[1] });
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getMin: function() {
|
getMin: function() {
|
||||||
|
|
Loading…
Reference in a new issue