Opened 13 years ago
Closed 13 years ago
#5372 closed enhancement (fixed)
[patch][cla]Difficult to set float with dojo.style
Reported by: | guest | Owned by: | sjmiles |
---|---|---|---|
Priority: | high | Milestone: | 1.1 |
Component: | HTML | Version: | 1.0 |
Keywords: | Cc: | [email protected]… | |
Blocked By: | Blocking: |
Description
To set a node's float, you have to do something like:
dojo.style(node, dojo.isIE ? "styleFloat" : "cssFloat", "right");
It would be nice if you could simply do:
dojo.style(node, "float", "right");
and have Dojo take care of the browser check.
"styleFloat" works in IE and Opera, "cssFloat" works in Mozilla, Safari, and Opera.
Attachments (2)
Change History (10)
comment:1 Changed 13 years ago by
Milestone: | → 1.2 |
---|
comment:2 Changed 13 years ago by
comment:3 Changed 13 years ago by
Summary: | Difficult to set float with dojo.style → [patch][cla]Difficult to set float with dojo.style |
---|
comment:5 Changed 13 years ago by
Milestone: | 1.2 → 1.1 |
---|
should we use "cssFloat" instead of "float", if that's what most browsers do?
comment:6 Changed 13 years ago by
Here is my proposed fix. I didn't commit it because I have not had time to write a unit test. If any of you guys want to commit this, or dante's version, it's ok with me.
above dojo.style:
var _floatStyle = dojo.isIE ? "styleFloat" : "cssFloat"; var _floatAliases = { "cssFloat": _floatStyle, "styleFloat": _floatStyle, "float": _floatStyle };
inside dojo.style:
style = _floatAliases[style] || style;
Attached.
comment:7 Changed 13 years ago by
+1 from me. that means "float":"left", "cssFloat":"left" and styleFloat:"left" all will work. and compresses slightly better. go sjmiles.
comment:8 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
first line of dojo.style function:
seems like a fix.