From 49f127dbd15b988959bf60bcafb490f7d43abc5f Mon Sep 17 00:00:00 2001 From: james Date: Fri, 11 Jun 2010 20:39:29 +0000 Subject: [PATCH] Properly set the width of each event when its placed on the schedule based on the size of the table cell its going into, and re-place all the events on window.resize :) --- admin/schedule.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/admin/schedule.php b/admin/schedule.php index 08d58789..10da4092 100644 --- a/admin/schedule.php +++ b/admin/schedule.php @@ -58,7 +58,7 @@ exit; } - echo "\n"; + echo "
\n"; echo ""; echo ""; foreach($locations AS $id=>$name) { @@ -171,6 +171,10 @@ } } }); + $(window).resize(function() { + placeEvents(); + } + ); }); function changeDate() { @@ -194,11 +198,13 @@ var tablecellid=eventobj.hour+'_'+eventobj.minute+'_'+eventobj.location; var eheight=((eventobj.duration/15)*)-; + var ewidth=$("#"+tablecellid).width()-; var p=$("#"+tablecellid).offset(); $("#"+item.id).css(p); $("#"+item.id).show(); $("#"+item.id).height(eheight); + $("#"+item.id).width(ewidth); } ); }