Ticket #244 (closed defect: fixed)
Visual.toggle() does not compute style of display property correctly
| Reported by: | jsmullyan@… | Owned by: | somebody |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | component1 | Version: | |
| Severity: | normal | Keywords: | |
| Cc: |
Description
toggle() does not work as I would expect when the actual initial display value is connected to a CSS rule rather than directly to the element's style. For instance, if you define a particular element in HTML as:
<div id="foo" class="hidden">
where hidden is defined as
.hidden { display: none;}
toggle won't know that the element is hidden, because it checks for whether "elem.style.display" is "none", rather than, say, calling getStyle(elem, 'display"), which would return the actual effective display value.
The actual effect of this is that for the first call to toggle, for an element hidden via CSS as above, toggle thinks the element is visible and disappears it. Thereafter, elem.style has the information locally and toggle works as you'd want it to.
