Various updates to Office Addin web scripts

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5903 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mike Hatfield
2007-06-11 07:58:41 +00:00
parent a3c59244d1
commit 43b4bf058a
15 changed files with 428 additions and 176 deletions

View File

@@ -4,7 +4,16 @@
*/
var OfficeMyAlfresco =
{
TOGGLE_AMOUNT: 150,
ANIM_LENGTH: 800,
init: function()
{
OfficeMyAlfresco.setupTasks();
OfficeMyAlfresco.setupToggles();
},
setupTasks: function()
{
var tasks = $$('#taskList .taskItem');
@@ -37,7 +46,7 @@ var OfficeMyAlfresco =
// register 'click' event for each task
task.addEvent('click', function(e)
{
window.location.href = window.serviceContextPath + "/office/myTasks?p=" + window.queryObject.p + "&t=" + task.id;
window.location.href = window.serviceContextPath + "/office/myTasks?p=" + window.queryObject.p + "&t=" + task.id.replace(/\./, "$");
});
});
@@ -49,8 +58,80 @@ var OfficeMyAlfresco =
task.removeClass('taskItemSelected');
});
});
}
},
setupToggles: function()
{
// Elements of interest
var panels = $$('.togglePanel');
var toggles = $$('.toggle');
// Animation
var fxPanel = new Fx.Elements(panels, {wait: false, duration: OfficeMyAlfresco.ANIM_LENGTH, transition: Fx.Transitions.Back.easeInOut});
panels.each(function(panel, i)
{
toggle = toggles[i];
panel.defaultHeight = panel.getStyle('height').toInt();
panel.isToggled = false;
toggle.addEvent('click', function(e)
{
var animPanel = {};
if (panel.isToggled)
{
panel.isToggled = false;
this.removeClass('toggled');
animPanel[i] =
{
'height': [panel.getStyle('height').toInt(), panel.defaultHeight]
};
// reset all other panels
panels.each(function(otherPanel, j)
{
if (otherPanel != panel)
{
// reset panel
otherPanel.isToggled = false;
toggles[j].removeClass('toggled');
animPanel[j] =
{
'height': [otherPanel.getStyle('height').toInt(), otherPanel.defaultHeight]
};
}
});
}
else
{
panel.isToggled = true;
this.addClass('toggled');
animPanel[i] =
{
'height': [panel.getStyle('height').toInt(), panel.defaultHeight + (OfficeMyAlfresco.TOGGLE_AMOUNT * (panels.length - 1))]
};
// set all other panels
panels.each(function(otherPanel, j)
{
if (otherPanel != panel)
{
// set panel
otherPanel.isToggled = false;
toggles[j].removeClass('toggled');
animPanel[j] =
{
'height': [otherPanel.getStyle('height').toInt(), otherPanel.defaultHeight - OfficeMyAlfresco.TOGGLE_AMOUNT]
};
}
});
}
fxPanel.start(animPanel);
});
});
}
};
window.addEvent('domready', OfficeMyAlfresco.init);