r105817 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105816‎ | r105817 | r105818 >
Date:19:12, 11 December 2011
Author:brion
Status:deferred
Tags:
Comment:
clicky thing to show the toc overview
Modified paths:
  • /trunk/mockups/mobile-sections/sections.css (modified) (history)
  • /trunk/mockups/mobile-sections/sections.js (modified) (history)

Diff [purge]

Index: trunk/mockups/mobile-sections/sections.js
@@ -104,11 +104,20 @@
105105 a.href = '#' + header.id;
106106 a.onclick = function() {
107107 wm_toggle_section(header.section);
 108+ magicToc.style.display = 'none';
108109 };
109110 li.appendChild(a);
110111 ul.appendChild(li);
111112 })();
112113 }
 114+
 115+ var magicTocTrigger = document.createElement('div');
 116+ magicTocTrigger.id = 'magic-toc-trigger';
 117+ magicTocTrigger.onclick = function() {
 118+ magicToc.style.display = 'block';
 119+ }
 120+ magicTocTrigger.textContent = 'Contents';
 121+ magicToc.parentNode.insertBefore(magicTocTrigger, magicToc);
113122 }
114123
115124 createSection0();
Index: trunk/mockups/mobile-sections/sections.css
@@ -9,9 +9,22 @@
1010 background: #eee;
1111 border: solid 1px #bbb;
1212
13 - box-shadow: inset 0 0 1em #aaa;
 13+ box-shadow: inset 0 0 1em #aaa;
 14+}
1415
 16+#magic-toc-trigger {
 17+ display: block;
 18+ position: fixed;
 19+ right: 0;
 20+ top: 0;
 21+ width: 80px;
 22+ height: 22px;
 23+
 24+ text-align: center;
 25+ padding-top: 8px;
1526
 27+ background: #eee;
 28+ border: solid 1px #bbb;
1629 }
1730
1831
@@ -24,7 +37,7 @@
2538 }
2639
2740 #magic-toc {
28 - display: block;
 41+ display: block !important;
2942 position: fixed;
3043 left: 0;
3144 top: 0;
@@ -32,4 +45,7 @@
3346 width: 320px;
3447 }
3548
 49+ #magic-toc-trigger {
 50+ display: none;
 51+ }
3652 }