summaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-11-15 21:33:54 +0100
committermsquare <msquare@notrademark.de>2016-11-15 21:33:54 +0100
commit79ca2f177203b9514c8f351eff4e24b6b4996af5 (patch)
treeb06a4d3c37ae3087fab0d38b3f4156837632b404 /public/js
parent5299ca210319b324564a889dcb2d7b651117f7eb (diff)
add fixed shift calendar headers and timelane
Diffstat (limited to 'public/js')
-rw-r--r--public/js/shift-calendar.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/public/js/shift-calendar.js b/public/js/shift-calendar.js
new file mode 100644
index 00000000..357b69ff
--- /dev/null
+++ b/public/js/shift-calendar.js
@@ -0,0 +1,30 @@
+/**
+ * Enables the fixed headers and time lane for the shift-calendar.
+ */
+$(document).ready(
+ function() {
+ var time_lanes = $(".shift-calendar .time");
+ var headers = $(".shift-calendar .header");
+ var top_reference = $(".container-fluid .row");
+ var top = headers.offset().top;
+ var left = 15;
+ time_lanes.css({
+ "position" : "relative",
+ "z-index" : 1000
+ });
+ headers.css({
+ "position" : "relative",
+ "z-index" : 900
+ });
+ $(window).scroll(
+ function() {
+ time_lanes.css({
+ "left" : Math.max(0, $(window).scrollLeft() - left) + "px"
+ });
+ headers.css({
+ "top" : Math.max(0, $(window).scrollTop() - top
+ + top_reference.offset().top)
+ + "px"
+ });
+ });
+ }); \ No newline at end of file