Set the events/tasks list collapsable

This commit is contained in:
Francis Lachapelle
2013-07-11 13:46:38 -04:00
parent e687dbf155
commit b8e2255a07
10 changed files with 255 additions and 244 deletions

View File

@@ -3205,6 +3205,11 @@ function deletePersonalCalendarCallback(http) {
}
function configureLists() {
// Move calendar view if lists are collapsed
if (!$("schedulerTabs").visible()) {
$('calendarView').setStyle({ top: '0' }).show();
}
// TASK LIST
var list = $("tasksList");
list.multiselect = true;
@@ -3292,6 +3297,37 @@ function drawNowLine() {
}
}
function onListCollapse(event, element) {
var img = element.select('img').first();
var tabs = $("schedulerTabs");
var handle = $("rightDragHandle");
var view = jQuery("#calendarView");
var state = 'collapse';
if (tabs.visible()) {
img.removeClassName('collapse').addClassName('rise');
handle.hide();
view.animate({ top: '0' }, 200, function() {
tabs.hide();
});
}
else {
state = 'rise';
img.removeClassName('rise').addClassName('collapse');
tabs.show();
tabs.controller.onWindowResize();
view.animate({ top: handle.getStyle('top') }, 200, function() {
handle.show();
});
}
var url = ApplicationBaseURL + "saveListState";
var params = "state=" + state;
triggerAjaxRequest(url, null, null, params,
{ "Content-type": "application/x-www-form-urlencoded" });
}
function onDocumentKeydown(event) {
var target = Event.element(event);
if (target.tagName != "INPUT") {
@@ -3367,7 +3403,7 @@ function initScheduler() {
// Calendar import form
$("uploadCancel").observe("click", hideCalendarImport);
$("uploadOK").observe("click", hideImportResults);
$("calendarView").on("click", "#listCollapse", onListCollapse);
Event.observe(document, "keydown", onDocumentKeydown);
}