mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5598 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
82 lines
2.3 KiB
JavaScript
82 lines
2.3 KiB
JavaScript
var MyWebForms = {
|
|
|
|
start: function()
|
|
{
|
|
if ($('formsPanel'))
|
|
{
|
|
MyWebForms.parseFormsPanels();
|
|
$('formsPanel').setStyle('visibility', 'visible');
|
|
}
|
|
},
|
|
|
|
parseFormsPanels: function()
|
|
{
|
|
var projects = $$('#formsPanel .webProjectRow');
|
|
var frms = $$('#formsPanel .webProjectForms');
|
|
var fxForm = new Fx.Elements(frms, {wait: false, duration: 300, transition: Fx.Transitions.linear});
|
|
|
|
projects.each(function(project, i)
|
|
{
|
|
var frm = frms[i];
|
|
|
|
// animated elements defaults
|
|
frm.maxHeight = frm.getStyle('height').toInt();
|
|
frm.defHeight = 1;
|
|
frm.setStyle('height', 0);
|
|
frm.setStyle('opacity', 0);
|
|
|
|
// register 'mouseenter' (subclassed mouseover) event for each project
|
|
project.addEvent('mouseenter', function(e)
|
|
{
|
|
var animForm = {};
|
|
|
|
// slide and fade in the frms panel
|
|
animForm[i] =
|
|
{
|
|
'height': [frm.getStyle('height').toInt(), frm.maxHeight],
|
|
'opacity': [frm.getStyle('opacity'), 1]
|
|
};
|
|
|
|
// reset styles on all other frms
|
|
projects.each(function(otherProject, j)
|
|
{
|
|
var otherfrm = frms[j];
|
|
|
|
if (otherProject != project)
|
|
{
|
|
// does this frm panel need resetting back to it's default height?
|
|
var h = otherfrm.getStyle('height').toInt();
|
|
if (h != otherfrm.defHeight)
|
|
{
|
|
animForm[j] =
|
|
{
|
|
'height': [h, otherfrm.defHeight],
|
|
'opacity': [otherfrm.getStyle('opacity'), 0]};
|
|
}
|
|
}
|
|
});
|
|
fxForm.start(animForm);
|
|
});
|
|
});
|
|
|
|
$('formsPanel').addEvent('mouseleave', function(e)
|
|
{
|
|
// handler for mouse leaving the entire panel
|
|
var animForm = {};
|
|
|
|
projects.each(function(project, i)
|
|
{
|
|
var frm = frms[i];
|
|
|
|
animForm[i] =
|
|
{
|
|
'height': [frm.getStyle('height').toInt(), frm.defHeight],
|
|
'opacity': [frm.getStyle('opacity'), 0]
|
|
};
|
|
});
|
|
fxForm.start(animForm);
|
|
});
|
|
}
|
|
};
|
|
|
|
window.addEvent('load', MyWebForms.start); |