From b84be05da7207b2636053e3ace20c062ba489d1e Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Wed, 27 May 2015 01:06:07 -0500 Subject: [PATCH] Fix sticky bar after PJAX navigation Also fix crash rendering db timezone on PHP 5.3 --- include/class.timezone.php | 2 +- scp/js/scp.js | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/class.timezone.php b/include/class.timezone.php index 10449350c..7ccd3b3d9 100644 --- a/include/class.timezone.php +++ b/include/class.timezone.php @@ -348,7 +348,7 @@ class DbTimezone { } function get_by_dst($preliminary_timezone) { - $rules = []; + $rules = array(); foreach (self::$dst_rules['years'] as $Y) { $rules[] = $this->dst_dates($Y); } diff --git a/scp/js/scp.js b/scp/js/scp.js index e356e825e..0c2e7ee7a 100644 --- a/scp/js/scp.js +++ b/scp/js/scp.js @@ -464,8 +464,15 @@ var scp_prep = function() { onmove(); } + // Drop the sticky bar on PJAX navigation + $(document).on('pjax:click', function() { + placeholder.removeAttr('style'); + $that.stop().removeClass('fixed'); + $(window).off('.sticky'); + }); + $that.find('.content').width($that.width()); - $(window).scroll(function (event) { + $(window).on('scroll.sticky', function (event) { // what the y position of the scroll is var y = $(this).scrollTop(); -- GitLab