mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -05:00
Convert values of numeric items to numbers.
This commit is contained in:
parent
26e3090b40
commit
a646f922d4
1 changed files with 4 additions and 1 deletions
|
@ -28,7 +28,8 @@ var Component = this.Component = Base.extend(Callback, /** @lends Component# */{
|
|||
},
|
||||
|
||||
number: {
|
||||
type: 'number'
|
||||
type: 'number',
|
||||
number: true
|
||||
},
|
||||
|
||||
button: {
|
||||
|
@ -81,6 +82,8 @@ var Component = this.Component = Base.extend(Callback, /** @lends Component# */{
|
|||
if (typeof key === 'function')
|
||||
key = null;
|
||||
var value = DomElement.get(this, key || 'value');
|
||||
if (that._info.number)
|
||||
value = Base.toFloat(value);
|
||||
if (fireChange) {
|
||||
that.palette.fire('change', that, that.name, value);
|
||||
that.fire('change', value);
|
||||
|
|
Loading…
Reference in a new issue