diff --git a/core/modules/startup/story.js b/core/modules/startup/story.js index b8a92bc58..ec0202c1f 100644 --- a/core/modules/startup/story.js +++ b/core/modules/startup/story.js @@ -133,6 +133,8 @@ function openStartupTiddlers(options) { target = target.substr(2,target.length - 4); } $tw.wiki.addToHistory(target); + } else if(storyList.length > 0) { + $tw.wiki.addToHistory(storyList[0]); } } diff --git a/core/modules/utils/dom/scroller.js b/core/modules/utils/dom/scroller.js index 786c54321..1b1ca82b8 100644 --- a/core/modules/utils/dom/scroller.js +++ b/core/modules/utils/dom/scroller.js @@ -85,8 +85,8 @@ PageScroller.prototype.scrollIntoView = function(element) { }, endX = getEndPos(bounds.left,bounds.width,scrollPosition.x,window.innerWidth), endY = getEndPos(bounds.top,bounds.height,scrollPosition.y,window.innerHeight); - // Only scroll if necessary - if(endX !== scrollPosition.x || endY !== scrollPosition.y) { + // Only scroll if the position has changed, plus a special case that we won't scroll less than 50 pixels from the top of the window + if((endX !== scrollPosition.x || endY !== scrollPosition.y) && (scrollPosition.y !== 0 || endY > 50)) { var self = this, drawFrame; drawFrame = function () {