Element#setStyle improvement: Assume Number values as px
Reported by Douwe M. | January 7th, 2010 @ 07:19 PM
This sets the height
of the element to '123px', as
expected:
element.setStyle('height', '123px');
But this doesn't, as value
is a Number, where
element.style
only recognizes Strings:
element.setStyle('height', 123);
Why not automagically change value
to value +
'px'
when isNumber(value)
, as this is what the
user intended in 99% of the time?Comments and changes to this ticket
-
MadRabbit January 8th, 2010 @ 01:13 PM
- State changed from new to invalid
Although I agreed that sometimes it is kinda pain the ass, but it's better the developer will run into the limitation during the development time and define things clearly, rather than wonder wtf in debugging.
And there is nothing more frustrating than spending time debugging some smartass features.
Sorry, no go.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
RightJS Core Tickets