Calendar list does not send an event - just open the popup in the middle

This commit is contained in:
Nathan Gray 2012-10-24 15:36:08 +00:00
parent c733797fe0
commit 8c133f883d

View File

@ -1029,15 +1029,34 @@ var calendar_edit_id;
var calendar_edit_date; var calendar_edit_date;
function edit_series(event,id,date) function edit_series(event,id,date)
{ {
// Coming from list, there is no event
if(arguments.length == 2)
{
date = id;
id = event;
event = null;
}
calendar_edit_id = id; calendar_edit_id = id;
calendar_edit_date = date; calendar_edit_date = date;
var popup = jQuery("#edit_series").show(); var popup = jQuery("#edit_series").show();
popup.css({
position: "absolute", if(event)
top: event.pageY, {
left: (event.pageX + popup.width() > $j(window).width() ? $j(window).width() - popup.width() : event.pageX) // If there is a mouse event, open the popup there
}); popup.css({
position: "absolute",
top: event.pageY,
left: (event.pageX + popup.width() > $j(window).width() ? $j(window).width() - popup.width() : event.pageX)
});
} else {
// Open popup in the middle
popup.css({
position: "absolute",
top: $j(window).height()/2-popup.height()/2,
left: $j(window).width()/2-popup.width()/2
});
}
} }
function open_edit(series) function open_edit(series)
{ {