64
64
hide_div = setTimeout("$('search_terms').setStyle('display','none')", 300);
66
var Colapsable = new Class({
67
initialize: function(item,expand_icon,open_content,close_content,is_open)
70
if ($defined(is_open))
72
this.is_open = is_open;
75
item.set('colapsable',this);
76
this.open_content = open_content;
77
this.close_content = close_content;
78
this.expand_icon = expand_icon;
80
var expander = new Fx.Slide(this.item, { duration: 200 } );
84
if ($defined(this.expand_icon))
86
this.expand_icon.set('src',this.expand_icon.title);
91
if ($defined(this.expand_icon))
93
this.expand_icon.set('src',this.expand_icon.alt);
100
this.item.setStyle('display', 'block');
101
var expander = this.item.get('slide');
103
if ($defined(this.open_content))
105
for (var i=0;i<this.open_content.length;++i)
107
this.open_content[i].setStyle('display','block');
111
if ($defined(this.close_content))
113
for (var i=0;i<this.close_content.length;++i)
115
this.close_content[i].setStyle('display','none');
119
if ($defined(this.expand_icon))
121
this.expand_icon.set('src',this.expand_icon.alt);
128
var expander = this.item.get('slide');
130
if ($defined(this.open_content))
132
for (var i=0;i<this.open_content.length;++i)
134
this.open_content[i].setStyle('display','none');
138
if ($defined(this.close_content))
140
for (var i=0;i<this.close_content.length;++i)
142
this.close_content[i].setStyle('display','block');
145
if ($defined(this.expand_icon))
147
this.expand_icon.set('src',this.expand_icon.title);
149
this.is_open = false;
171
window.addEvent('domready', function()
173
$$('.revision_log').each(function(item, i)
175
var item_slide = item.getElement('.revisioninfo');
176
var open_content = new Array();
177
var close_content = new Array();
178
open_content.push(item.getElement('.long_description'));
179
close_content.push(item.getElement('.short_description'));
180
var expand_icon = item.getElement('.expand_icon');
181
var colapsable = new Colapsable(item_slide,expand_icon,open_content,close_content);
183
item.getElement('.expand_revisioninfo').addEvent('click',function(){colapsable.toggle();});
184
item.colapsable = colapsable;
187
$$('.diffBox').each(function(item, i)
189
var item_slide = item.getNext('.diffinfo');
190
var expand_icon = item.getElement( '.expand_diff' );
191
var colapsable = new Colapsable(item_slide,expand_icon,null,null,true);
192
item.getElement( '.expand_diff' ).addEvent( 'click', function(){colapsable.toggle();});
193
item.colapsable=colapsable;
197
function toggle_expand_all(action)
199
$$('.revision_log').each(function(item, i)
201
var colapsable = item.colapsable;
202
if(action == 'close')
204
$('expand_all').setStyle('display','block');
205
$('collapse_all').setStyle('display','none');
208
else if(action == 'open')
210
$('expand_all').setStyle('display','none');
211
$('collapse_all').setStyle('display','block');
217
function toggle_expand_all_revisionview(action)
219
$$('.diffBox').each(function(item, i)
221
var colapsable = item.colapsable;
222
if(action == 'close')
224
$('expand_all').setStyle('display','block');
225
$('collapse_all').setStyle('display','none');
228
else if(action == 'open')
230
$('expand_all').setStyle('display','none');
231
$('collapse_all').setStyle('display','block');