From 16169d53823e1c01bb63615849e96542aeff3c29 Mon Sep 17 00:00:00 2001 From: benweet Date: Tue, 19 Nov 2013 23:46:16 +0000 Subject: [PATCH] Fixed first section in scroll link extension --- public/res/extensions/scrollLink.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/res/extensions/scrollLink.js b/public/res/extensions/scrollLink.js index 39921196..cb9e25b3 100644 --- a/public/res/extensions/scrollLink.js +++ b/public/res/extensions/scrollLink.js @@ -106,7 +106,7 @@ define([ // Something wrong in the algorithm... return; } - var posInSection = (srcScrollTop - srcSection.startOffset) / srcSection.height; + var posInSection = (srcScrollTop - srcSection.startOffset) / (srcSection.height || 1); var destSection = destSectionList[sectionIndex]; return destSection.startOffset + destSection.height * posInSection; }