[Rt-devel] Re: [Rt-commit] r3277 - in rt/branches/CHALDEA-EXPERIMENTAL: . bin html html/Elements html/Ticket html/Ticket/Elements lib/RT

Ruslan U. Zakirov Ruslan.Zakirov at miet.ru
Tue Jul 5 21:37:25 EDT 2005


alexmv at bestpractical.com wrote:
> Author: alexmv
> Date: Fri Jul  1 16:12:56 2005
> New Revision: 3277
> 
[snip]
> 
> Added: rt/branches/CHALDEA-EXPERIMENTAL/html/rt.js
> ==============================================================================
> --- (empty file)
> +++ rt/branches/CHALDEA-EXPERIMENTAL/html/rt.js	Fri Jul  1 16:12:56 2005
> @@ -0,0 +1,19 @@
> +% $r->content_type('application/x-javascript');
> +
> +function hideshow(num) {
> +    idstring = "element-" + num;
> +    chunk = document.getElementById(idstring);
> +    if ( chunk.style.display == "none")  {
> +    chunk.style.display = chunk.style.tag;
> +    } else {
> +        chunk.style.tag = chunk.style.display;
> +        chunk.style.display = "none";
> +    }
> +}   
> +
This is not crossbrowser hideshow function.
Should be something like:
<<<
if (t.className.match(/\bhidden\b/))
  t.className = t.className.replace(/\s?\bhidden\b/, '');
else
  t.className += ' hidden';
>>>
+ CSS record for "hidden" class


also should be more generic:
    idstring = "element-" + num;
is crap. function should take DOM object or object id.

--
Ruslan.


More information about the Rt-devel mailing list