Reluctantly letting users throw units onto dimensions. If we have a way to warn, not block, on errors, we should use that eventually
This commit is contained in:
parent
a1a64c6f35
commit
b1711d68c0
@ -7,10 +7,6 @@ tree.Dimension = function (value, unit) {
|
||||
this.value = parseFloat(value);
|
||||
this.unit = unit || null;
|
||||
this.is = 'float';
|
||||
// TODO: rewrite, this gives me the heebie-jeebies
|
||||
if (parseFloat(value) == parseInt(value, 10)) {
|
||||
// this.is = ['float', 'int'];
|
||||
}
|
||||
};
|
||||
|
||||
tree.Dimension.prototype = {
|
||||
@ -19,8 +15,7 @@ tree.Dimension.prototype = {
|
||||
return new(tree.Color)([this.value, this.value, this.value]);
|
||||
},
|
||||
toCSS: function () {
|
||||
var css = this.value + this.unit;
|
||||
return css;
|
||||
return this.value;
|
||||
},
|
||||
|
||||
// In an operation between two Dimensions,
|
||||
|
Loading…
Reference in New Issue
Block a user