From a2281923406237a222f68fa2cc6d833164e44ffc Mon Sep 17 00:00:00 2001 From: iissnan Date: Mon, 27 Jul 2015 10:51:55 +0800 Subject: [PATCH] Bug: Site overview tab can't be activated when disable motion. #212 --- layout/_scripts/pages/post-details.swig | 95 +++++++++++++++---------- 1 file changed, 58 insertions(+), 37 deletions(-) diff --git a/layout/_scripts/pages/post-details.swig b/layout/_scripts/pages/post-details.swig index f930bd554..dbd7df2b1 100644 --- a/layout/_scripts/pages/post-details.swig +++ b/layout/_scripts/pages/post-details.swig @@ -69,7 +69,6 @@ element.on('mousewheel DOMMouseScroll', function (event) { var oe = event.originalEvent; var delta = oe.wheelDelta || -oe.detail; - var self = this; this.scrollTop += ( delta < 0 ? 1 : -1 ) * 30; event.preventDefault(); @@ -79,57 +78,79 @@ } function tocOverflowIndicator (indicator, action) { - $(indicator).velocity('stop').velocity({ - opacity: action === 'show' ? 0.4 : 0 - }, { duration: 100 }); + var $indicator = $(indicator); + var opacity = action === 'show' ? 0.4 : 0; + $indicator.velocity ? + $indicator.velocity('stop').velocity({ + opacity: opacity + }, { duration: 100 }) : + $indicator.stop().animate({ + opacity: opacity + }, 100); } }); -{% if theme.use_motion %} - -{% endif %} + } + }); +