jenkins-bot has submitted this change and it was merged.
Change subject: Support internal redirects
......................................................................
Support internal redirects
Bug: 69020
Change-Id: I88f847b488d57c3c3f4dab6bac6cd41a371640de
---
M javascripts/modules/toggling/toggle.js
1 file changed, 9 insertions(+), 1 deletion(-)
Approvals:
MaxSem: Looks good to me, approved
Bmansurov: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/javascripts/modules/toggling/toggle.js
b/javascripts/modules/toggling/toggle.js
index 7c45691..614fc75 100644
--- a/javascripts/modules/toggling/toggle.js
+++ b/javascripts/modules/toggling/toggle.js
@@ -57,6 +57,8 @@
}
if ( $heading.length && !$heading.hasClass(
'openSection' ) ) {
toggle( $heading );
+ }
+ if ( $heading.length ) {
// scroll again after opening section (opening
section makes the page longer)
window.scrollTo( 0, $target.offset().top );
}
@@ -118,9 +120,15 @@
} );
function checkHash() {
- var hash = window.location.hash;
+ var internalRedirect = mw.config.get(
'wgInternalRedirectTargetUrl' ),
+ hash = window.location.hash;
+
if ( hash.indexOf( '#' ) === 0 ) {
reveal( hash );
+ } else if ( internalRedirect ) {
+ internalRedirect = '#' +
internalRedirect.split( '#' )[1];
+ window.location.hash = internalRedirect;
+ reveal( internalRedirect );
}
}
checkHash();
--
To view, visit https://gerrit.wikimedia.org/r/162178
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I88f847b488d57c3c3f4dab6bac6cd41a371640de
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: Bmansurov <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits