r105850 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105849‎ | r105850 | r105851 >
Date:04:54, 12 December 2011
Author:brion
Status:ok
Tags:mobile 
Comment:
* (bug 32972) MobileFrontend: File page magic should show the appropriate section when linking to a #hash
Modified paths:
  • /trunk/extensions/MobileFrontend/javascripts/filepage.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/javascripts/filepage.js
@@ -67,7 +67,6 @@
6868 }
6969 }
7070 }
71 - return false;
7271 };
7372 }
7473
@@ -102,6 +101,14 @@
103102 }
104103
105104 stopClickThrough();
106 -makeToggle('file')();
107105
 106+var initial = 'file';
 107+if (window.location.hash) {
 108+ var section = window.location.hash.substr(1);
 109+ if (section in chunks) {
 110+ initial = section;
 111+ }
 112+}
 113+makeToggle(initial)();
 114+
108115 })();

Status & tagging log