mediawiki.action.view.redirect: Explicitly scroll to element in hash
authorjdlrobson <jdlrobson@gmail.com>
Mon, 14 Dec 2015 23:52:39 +0000 (15:52 -0800)
committerTimo Tijhof <krinklemail@gmail.com>
Fri, 18 Dec 2015 00:28:02 +0000 (16:28 -0800)
commitf6a0f87dcb85a38656f52ac677d10b00f5035c58
treeb58a9492d874d0f573708c70f956db8b9e4d737b
parent1e8f67cbb3681d876006fbb378a80baf9a360619
mediawiki.action.view.redirect: Explicitly scroll to element in hash

Specification of replaceState doesn't state whether the browser should scroll to the element
matching the fragment [1]. It only determines how to alter the history stack.
(The fact it doesn't impact UI is sometimes a desired behaviour [2)]

As a result force a scroll to the element. Harmless if element is already present.

[1] http://www.w3.org/TR/2011/WD-html5-20110113/history.html#the-history-interface
[2] http://lea.verou.me/2011/05/change-url-hash-without-page-jump/

Bug: T110501
Change-Id: I7440f7a6a6dd20d984da1834007d581324fb96f4
resources/src/mediawiki.action/mediawiki.action.view.redirect.js