forked from science-ation/science-ation
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 :)
This commit is contained in:
parent
76f1a79fe7
commit
49f127dbd1
@ -58,7 +58,7 @@
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<table class=\"schedule\">\n";
|
echo "<table class=\"schedule\" id=\"schedule\">\n";
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
echo "<th style=\"width: 50px;\"> </th>";
|
echo "<th style=\"width: 50px;\"> </th>";
|
||||||
foreach($locations AS $id=>$name) {
|
foreach($locations AS $id=>$name) {
|
||||||
@ -171,6 +171,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$(window).resize(function() {
|
||||||
|
placeEvents();
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
function changeDate() {
|
function changeDate() {
|
||||||
@ -194,11 +198,13 @@
|
|||||||
var tablecellid=eventobj.hour+'_'+eventobj.minute+'_'+eventobj.location;
|
var tablecellid=eventobj.hour+'_'+eventobj.minute+'_'+eventobj.location;
|
||||||
|
|
||||||
var eheight=((eventobj.duration/15)*<?=$ROWHEIGHT?>)-<? echo $BORDERSIZE*2; ?>;
|
var eheight=((eventobj.duration/15)*<?=$ROWHEIGHT?>)-<? echo $BORDERSIZE*2; ?>;
|
||||||
|
var ewidth=$("#"+tablecellid).width()-<? echo $BORDERSIZE; ?>;
|
||||||
|
|
||||||
var p=$("#"+tablecellid).offset();
|
var p=$("#"+tablecellid).offset();
|
||||||
$("#"+item.id).css(p);
|
$("#"+item.id).css(p);
|
||||||
$("#"+item.id).show();
|
$("#"+item.id).show();
|
||||||
$("#"+item.id).height(eheight);
|
$("#"+item.id).height(eheight);
|
||||||
|
$("#"+item.id).width(ewidth);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user