Skip to content

Commit

Permalink
FIX: sidebar scrollable in all schemes [25].
Browse files Browse the repository at this point in the history
1. Add `post_block` motion effects on `.pagination` and `.comments` [3].
2. Add motion for sidebar in Pisces | Gemini [2].
  • Loading branch information
ivan-nginx authored Sep 28, 2017
1 parent 11c5d1c commit 867fdbd
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion source/js/src/motion.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,16 @@ $(document).ready(function () {

postList: function (integrator) {
//var $post = $('.post');
var $postBlock = $('.post-block');
var $postBlock = $('.post-block, .pagination, .comments');
var $postBlockTransition = CONFIG.motion.transition.post_block;
var $postHeader = $('.post-header');
var $postHeaderTransition = CONFIG.motion.transition.post_header;
var $postBody = $('.post-body');
var $postBodyTransition = CONFIG.motion.transition.post_body;
var $collHeader = $('.collection-title, .archive-year');
var $collHeaderTransition = CONFIG.motion.transition.coll_header;
var $sidebarAffix = $('.sidebar-inner');
var $sidebarAffixTransition = CONFIG.motion.transition.sidebar;
var hasPost = $postBlock.size() > 0;

hasPost ? postMotion() : integrator.next();
Expand All @@ -312,6 +314,10 @@ $(document).ready(function () {
drag: true
};
postMotionOptions.complete = function () {
// After motion complete need to remove transform from sidebar to let affix work on Pisces | Gemini.
if (CONFIG.motion.transition.sidebar && (NexT.utils.isPisces() || NexT.utils.isGemini())) {
$sidebarAffix.css({ 'transform': 'initial' });
}
integrator.next();
};

Expand All @@ -328,6 +334,10 @@ $(document).ready(function () {
if (CONFIG.motion.transition.coll_header) {
$collHeader.velocity('transition.' + $collHeaderTransition, postMotionOptions);
}
// Only for Pisces | Gemini.
if (CONFIG.motion.transition.sidebar && (NexT.utils.isPisces() || NexT.utils.isGemini())) {
$sidebarAffix.velocity('transition.' + $sidebarAffixTransition, postMotionOptions);
}
}
},

Expand Down

0 comments on commit 867fdbd

Please sign in to comment.