Marcus-crane has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/389283 )

Change subject: Added use of HTML5 push state with a fallback for older 
browsers.
......................................................................

Added use of HTML5 push state with a fallback for older browsers.

Use of location.hash when a tab name is identical to a heading, will
cause the browser to jump to the respective heading via anchor tag.

One effect of using push state is that this bug is then mitigated in
modern browsers.

Change-Id: I51bc0c244b5be0f55493a0ee2e233c9e0cbd6552
---
M js/tabber.js
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Tabber 
refs/changes/83/389283/1

diff --git a/js/tabber.js b/js/tabber.js
index 52bf8d3..9658039 100644
--- a/js/tabber.js
+++ b/js/tabber.js
@@ -40,7 +40,11 @@
                        nav.on( 'click', 'a', function( e ) {
                                var title = $( this ).attr( 'title' );
                                e.preventDefault();
-                               location.hash = '#' + title;
+                               if (history.pushState) {
+                                       history.pushState(null, null, '#' + 
title);
+                               } else {
+                                       location.hash = '#' + title;
+                               }
                                showContent( title );
                        } );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/389283
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I51bc0c244b5be0f55493a0ee2e233c9e0cbd6552
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Tabber
Gerrit-Branch: master
Gerrit-Owner: Marcus-crane <mar...@thingsima.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to