r103222 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103221‎ | r103222 | r103223 >
Date:21:10, 15 November 2011
Author:brion
Status:deferred
Tags:
Comment:
Footer / bottom toolbar tweaks to let it scroll as fixed
Modified paths:
  • /trunk/mockups/athena/athena.css (modified) (history)
  • /trunk/mockups/athena/athena.js (modified) (history)
  • /trunk/mockups/athena/index.html (modified) (history)

Diff [purge]

Index: trunk/mockups/athena/athena.css
@@ -51,6 +51,12 @@
5252 bottom: 0;
5353 }
5454
 55+#bottom-bar.inplace {
 56+ position: relative;
 57+ top: inherit;
 58+}
 59+
 60+
5561 .bar .detail {
5662 background-color: gray;
5763 }
Index: trunk/mockups/athena/index.html
@@ -12,7 +12,7 @@
1313
1414 <body>
1515
16 -<div class="bar-wrapper">
 16+<div id="top" class="bar-wrapper">
1717 <div id="top-bar" class="bar">
1818 <button class="button-main">Main</button>
1919 <span class="search-box" class="stretch">
@@ -26,7 +26,7 @@
2727
2828 <div id="page-content"></div>
2929
30 -<div class="bar-wrapper">
 30+<div id="bottom" class="bar-wrapper">
3131 <div id="bottom-bar" class="bar">
3232 <button class="button-article">Article</button>
3333 <span class="detail stretch">
@@ -36,34 +36,34 @@
3737 <button class="button-discuss">Discuss</button>
3838 <button class="button-language">Language</button>
3939 </div>
40 - <div class="footer">
41 - <div>
42 - <span class="search-box" class="stretch">
43 - <input class="search" placeholder="Search Wikipedia">
44 - </span>
45 - </div>
46 - <div>
47 - <a href="#recentchanges">Recent Changes</a> -
48 - <a href="#special">Special Pages</a> -
49 - <a href="#random">Random Article</a> -
50 - <a href="#donate">Donate to Wikipedia</a>
51 - </div>
52 - <div>
53 - <a href="#about">About Wikipedia</a> -
54 - <a href="#contact">Contact Wikipedia</a> -
55 - <a href="#privacy">Privacy policy</a> -
56 - <a href="#disclaimers">Disclaiimers</a>
57 - </div>
58 - <div>
59 - Text is available under the <a href="#cc">Creative Commons Attribution-ShareAlike License</a>, additional terms may apply.
60 - See <a href="#terms">Terms of Use</a> for details.
61 - Wikipedia is a registered trademark of the <a href="#wmf">Wikimedia Foundation, Inc.</a>, a non-profit organization.
62 - </div>
63 - <div class="poweredby-logos">
64 - <img src="https://bits.wikimedia.org/images/wikimedia-button.png">
65 - <img src="https://bits.wikimedia.org/skins-1.18/common/images/poweredby_mediawiki_88x31.png">
66 - </div>
 40+</div>
 41+<div id="footer" class="footer">
 42+ <div>
 43+ <span class="search-box" class="stretch">
 44+ <input class="search" placeholder="Search Wikipedia">
 45+ </span>
6746 </div>
 47+ <div>
 48+ <a href="#recentchanges">Recent Changes</a> -
 49+ <a href="#special">Special Pages</a> -
 50+ <a href="#random">Random Article</a> -
 51+ <a href="#donate">Donate to Wikipedia</a>
 52+ </div>
 53+ <div>
 54+ <a href="#about">About Wikipedia</a> -
 55+ <a href="#contact">Contact Wikipedia</a> -
 56+ <a href="#privacy">Privacy policy</a> -
 57+ <a href="#disclaimers">Disclaiimers</a>
 58+ </div>
 59+ <div>
 60+ Text is available under the <a href="#cc">Creative Commons Attribution-ShareAlike License</a>, additional terms may apply.
 61+ See <a href="#terms">Terms of Use</a> for details.
 62+ Wikipedia is a registered trademark of the <a href="#wmf">Wikimedia Foundation, Inc.</a>, a non-profit organization.
 63+ </div>
 64+ <div class="poweredby-logos">
 65+ <img src="https://bits.wikimedia.org/images/wikimedia-button.png">
 66+ <img src="https://bits.wikimedia.org/skins-1.18/common/images/poweredby_mediawiki_88x31.png">
 67+ </div>
6868 </div>
6969
7070 </body>
Index: trunk/mockups/athena/athena.js
@@ -111,6 +111,29 @@
112112 var app = {
113113 init: function() {
114114 embed.init();
 115+
 116+ $('.button-main').click(function() {
 117+ // temp hack
 118+ // toggle the floating state
 119+ $('.bar').toggleClass('bar-float');
 120+ });
 121+
 122+ // Fancy footwork to rebind a position-fixed footer bar when scrolling to bottom
 123+ $(window).bind('scroll', function() {
 124+ var viewportTop = $(document).scrollTop(),
 125+ windowHeight = $(window).height(),
 126+ viewportBottom = viewportTop + windowHeight,
 127+ barHeight = $('#bottom-bar').height(),
 128+ barTop = $('#bottom').position().top;
 129+
 130+ if (viewportBottom - barHeight >= barTop) {
 131+ console.log('should unfix');
 132+ $('#bottom-bar').addClass('inplace');
 133+ } else {
 134+ $('#bottom-bar').removeClass('inplace');
 135+ }
 136+ });
 137+
115138 app.loadPage('While My Guitar Gently Weeps');
116139 },
117140

Status & tagging log