diff options
author | msquare <msquare@notrademark.de> | 2017-11-28 15:43:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-28 15:43:51 +0100 |
commit | 599f2fd264bfc7b1b6826fe206442806e317340f (patch) | |
tree | 50cf84d7d07d11bd65b45c2c17f37632f6cd8eff /public/js/sticky-headers.js | |
parent | a5fc5bd0979e8de1fce8a8addd351a6e7bd6aeb8 (diff) | |
parent | eda7f7788ea8012bd8be46405c56a666c11f3fa5 (diff) |
Merge pull request #365 from engelsystem/feature-igel-rewrite
Feature igel rewrite
Diffstat (limited to 'public/js/sticky-headers.js')
-rw-r--r-- | public/js/sticky-headers.js | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/public/js/sticky-headers.js b/public/js/sticky-headers.js index 1d6e9402..6e6a75e2 100644 --- a/public/js/sticky-headers.js +++ b/public/js/sticky-headers.js @@ -1,32 +1,31 @@ /** * Enables the fixed headers and time lane for the shift-calendar and datatables */ -$(document).ready( - function() { - if ($(".shift-calendar").length) { +$(document).ready(function () { + if ($(".shift-calendar").length) { var timeLanes = $(".shift-calendar .time"); var headers = $(".shift-calendar .header"); var topReference = $(".container-fluid .row"); - var top = headers.offset().top; - var left = 15; timeLanes.css({ - "position" : "relative", - "z-index" : 999 + "position": "relative", + "z-index": 999 }); headers.css({ - "position" : "relative", - "z-index" : 900 + "position": "relative", + "z-index": 900 }); $(window).scroll( - function() { - timeLanes.css({ - "left" : Math.max(0, $(window).scrollLeft() - left) + "px" - }); - headers.css({ - "top" : Math.max(0, $(window).scrollTop() - top - + topReference.offset().top) + function () { + var top = headers.parent().offset().top; + var left = 15; + timeLanes.css({ + "left": Math.max(0, $(window).scrollLeft() - left) + "px" + }); + headers.css({ + "top": Math.max(0, $(window).scrollTop() - top + + topReference.offset().top) + "px" - }); + }); }); - } - });
\ No newline at end of file + } +}); |