[Rt-commit] r3395 - in rt/branches/3.5-TESTING: . html html/Widgets
trs at bestpractical.com
trs at bestpractical.com
Tue Jul 5 21:55:16 EDT 2005
Author: trs
Date: Tue Jul 5 21:55:15 2005
New Revision: 3395
Modified:
rt/branches/3.5-TESTING/ (props changed)
rt/branches/3.5-TESTING/html/Widgets/TitleBoxStart
rt/branches/3.5-TESTING/html/rt.js
Log:
r4810 at wintermute: tom | 2005-07-05 21:49:45 -0400
Fixed hideshow() to make it more generalized (I'll be using it in other
places than the title boxes) as well as more cross-browser.
Modified: rt/branches/3.5-TESTING/html/Widgets/TitleBoxStart
==============================================================================
--- rt/branches/3.5-TESTING/html/Widgets/TitleBoxStart (original)
+++ rt/branches/3.5-TESTING/html/Widgets/TitleBoxStart Tue Jul 5 21:55:15 2005
@@ -45,7 +45,7 @@
%# END BPS TAGGED BLOCK }}}
<div class="titlebox">
<div class="title">
- <span><a href="#" onclick="return hideshow('<%$id%>');">^</a></span>
+ <span><a href="#" onclick="return hideshow('element-<%$id%>');">^</a></span>
<% $title_href && qq[<a $title_class href="$title_href">] | n %><% $title |n %><% $title_href && "</a>" |n%>
</div>
<div class="content" id="element-<%$id%>">
Modified: rt/branches/3.5-TESTING/html/rt.js
==============================================================================
--- rt/branches/3.5-TESTING/html/rt.js (original)
+++ rt/branches/3.5-TESTING/html/rt.js Tue Jul 5 21:55:15 2005
@@ -1,13 +1,15 @@
% $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";
+function hideshow(id) {
+ e = document.getElementById(id);
+
+ if (e.className.match(/\bhidden\b/))
+ e.className = e.className.replace(/\s?\bhidden\b/, '');
+ else {
+ if (e.className)
+ e.className += ' hidden';
+ else
+ e.className = 'hidden';
}
return false;
}
More information about the Rt-commit
mailing list