From 74a79353dbe24280124e025da1ff63e1b51cda14 Mon Sep 17 00:00:00 2001 From: Thomas Haddad Date: Fri, 31 Mar 2017 10:47:37 +0200 Subject: Refs #2946: Fix content in header not being reloaded properly (thanks to turbolinks) Signed-off-by: Thomas Shawarma Haddad --- app/assets/javascripts/main_menu.coffee | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'app/assets/javascripts') diff --git a/app/assets/javascripts/main_menu.coffee b/app/assets/javascripts/main_menu.coffee index c6bfc8408..9357cff34 100644 --- a/app/assets/javascripts/main_menu.coffee +++ b/app/assets/javascripts/main_menu.coffee @@ -20,22 +20,22 @@ $(document).on 'ready page:load', -> selectedItem.closest('.panel-title').children('a').attr('aria-expanded') == true # Sticky content - if ($('.page-action .small').length > 0) - data = $('.page-action .small')[0].innerHTML - - if ($(".page-title").length > 0) - ptitleCont = $(".page-title").html() - - stickyContent = '
' - stickyContent += '
' + ptitleCont + '
' - stickyContent += '
' + data + '
' - stickyContent += '
' # Sticky behavior $(document).on 'scroll', -> limit = 51 if $(window).scrollTop() >= limit + if ($('.page-action .small').length > 0) + data = $('.page-action .small')[0].innerHTML + + if ($(".page-title").length > 0) + ptitleCont = $(".page-title").html() + + stickyContent = '
' + stickyContent += '
' + ptitleCont + '
' + stickyContent += '
' + data + '
' + stickyContent += '
' $('#main_nav').addClass 'sticky' if $('#menu_top').find('.sticky-content').length == 0 -- cgit v1.2.3