diff --git a/CHANGES.txt b/CHANGES.txt index dde642a4..bdcd736f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,7 @@ New in 3.0.1.8 ============== - FIX: Issue #710: Wrong profile image used. - FIX: Issue #711: Space when blocks are docked. +- FIX: Issue #718: Affix top offset height when reload down page.. New in 3.0.1.7 ============== diff --git a/amd/build/affix.min.js b/amd/build/affix.min.js index 1a2812cc..568b320c 100644 --- a/amd/build/affix.min.js +++ b/amd/build/affix.min.js @@ -6,4 +6,4 @@ * @copyright 2015 Gareth J Barnard * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -define(["jquery","theme_essential/bootstrap","core/log"],function(a,b,c){"use strict";return c.debug("Essential affix AMD"),{init:function(){a(document).ready(function(a){if(a("#essentialnavbar").length){var b=a("#essentialnavbar"),d=b.offset().top;c.debug("Essential affix AMD offset: "+d);var e=a("#page-header").height();c.debug("Essential affix AMD pageheaderHeight: "+e),b.affix({offset:{top:function(){var f=a(window).scrollTop();c.debug("Essential affix AMD wst: "+f);var g=e-f;return c.debug("Essential affix AMD diff: "+g),0>g&&(g=0),b.css("top",g+"px"),d}}})}}),c.debug("Essential affix AMD init")}}}); \ No newline at end of file +define(["jquery","theme_essential/bootstrap","core/log"],function(a,b,c){"use strict";return c.debug("Essential affix AMD"),{init:function(){a(document).ready(function(a){if(a("#essentialnavbar").length){var b=a("#essentialnavbar"),d=a("#page-header").height();c.debug("Essential affix AMD pageheaderHeight: "+d),b.affix({offset:{top:function(){var e=a(window).scrollTop();c.debug("Essential affix AMD wst: "+e);var f=d-e;return c.debug("Essential affix AMD diff: "+f),0>f&&(f=0),b.css("top",f+"px"),d}}})}}),c.debug("Essential affix AMD init")}}}); \ No newline at end of file diff --git a/amd/src/affix.js b/amd/src/affix.js index 254974f6..fb68452c 100644 --- a/amd/src/affix.js +++ b/amd/src/affix.js @@ -19,8 +19,6 @@ define(['jquery', 'theme_essential/bootstrap', 'core/log'], function($, boot, lo $(document).ready(function($) { if ($('#essentialnavbar').length) { var $essentialnavbar = $('#essentialnavbar'); - var offset = $essentialnavbar.offset().top; - log.debug('Essential affix AMD offset: ' + offset); var pageheaderHeight = $('#page-header').height(); log.debug('Essential affix AMD pageheaderHeight: ' + pageheaderHeight); $essentialnavbar.affix({ @@ -34,7 +32,7 @@ define(['jquery', 'theme_essential/bootstrap', 'core/log'], function($, boot, lo diff = 0; } $essentialnavbar.css('top', diff + 'px'); - return offset; + return pageheaderHeight; } } });