Opened 14 years ago
Closed 14 years ago
#4216 closed bug (fixed)
css function does not handle negative width and height in key/value pairs
Reported by: | Simon_Francesco | Owned by: | brandon |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | core | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description (last modified by )
While the css function correctly handles a single property or height that is passed with a negative value it does not handle multiple key/value pairs. Existing code:
css: function( key, value ) { // ignore negative width and height values if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) value = undefined; return this.attr( key, value, "curCSS" ); } Suggested change: css: function( key, value ) { // ignore negative width and height values if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) value = undefined; if(typeof(key.height)!==undefined && parseFloat(key.height) < 0)key.height = undefined; if(typeof(key.width)!==undefined && parseFloat(key.width) < 0)key.width = undefined; return this.attr( key, value, "curCSS" ); }
Change History (4)
comment:1 follow-up: 3 Changed 14 years ago by
Owner: | set to brandon |
---|
comment:2 Changed 14 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 14 years ago by
comment:4 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
this is now fixed in r6318
Note: See
TracTickets for help on using
tickets.
See #4295 ...
I believe the proper approach here is to use a space separated (instead of an array) string that is similar to other places we do multiple values-like calls.