$(function(){
  function checkOverflow(){
    if($(window).width() >= "768"){
      if($(".related-positioning").length !== 0){
        var viewPort = $(window).height();
        var relatedBox = $(".related").height();
        var boxOffset = $(".related-positioning").position().top;
        if(relatedBox > (viewPort - boxOffset)){
          $(".related-positioning").css("position", "absolute");
          return true;
        } else {
          $(".related-positioning").css("position", "fixed");
          return false;
        }
      }
    }
    return false;
  }
  if(!checkOverflow()){
    window.GOVUK.stopScrollingAtFooter.addEl($('.related-positioning'), $('#related .inner').height());
  }
});

$(function(){
  function checkOverflow(){
    var $related = $(".related-positioning");
    if($related.length !== 0 && $related.css('position') == 'fixed') {
      var viewPort = $(window).height();
      var relatedBox = $(".related").height();
      var boxOffset = $related.position().top;
      if(relatedBox > (viewPort - boxOffset)){
        $related.css("position", "absolute");
        return true;
      } else {
        $related.css("position", "fixed");
        return false;
      }
    }

    return false;
  }

  if(!checkOverflow()){
    window.GOVUK.stopScrollingAtFooter.addEl($('.related-positioning'), $('#related .inner').height());
  }
});

Fix related box on tablet view
Fix related box on tablet view

checkOverflow now checks for position:fixed rather than window width.