r103225 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103224‎ | r103225 | r103226 >
Date:21:30, 15 November 2011
Author:brion
Status:deferred
Tags:
Comment:
temp disable the non-fixed mode; fix for fixed-tweak on the bottombar during resize
Modified paths:
  • /trunk/mockups/athena/athena.js (modified) (history)
  • /trunk/mockups/athena/frame-inner.js (modified) (history)
  • /trunk/mockups/athena/index.html (modified) (history)

Diff [purge]

Index: trunk/mockups/athena/index.html
@@ -13,7 +13,7 @@
1414 <body>
1515
1616 <div id="top" class="bar-wrapper">
17 - <div id="top-bar" class="bar">
 17+ <div id="top-bar" class="bar bar-float">
1818 <button class="button-main">Main</button>
1919 <span class="search-box" class="stretch">
2020 <input class="search" placeholder="Search Wikipedia">
@@ -27,7 +27,7 @@
2828 <div id="page-content"></div>
2929
3030 <div id="bottom" class="bar-wrapper">
31 - <div id="bottom-bar" class="bar">
 31+ <div id="bottom-bar" class="bar bar-float">
3232 <button class="button-article">Article</button>
3333 <span class="detail stretch">
3434 <button class="button-history">History</button>
Index: trunk/mockups/athena/athena.js
@@ -81,8 +81,25 @@
8282 document.location = data.url;
8383 }
8484 });
 85+
 86+ // Fancy footwork to rebind a position-fixed footer bar when scrolling to bottom
 87+ $(window).bind('scroll', function() {
 88+ var viewportTop = $(document).scrollTop(),
 89+ windowHeight = $(window).height(),
 90+ viewportBottom = viewportTop + windowHeight,
 91+ barHeight = $('#bottom-bar').height(),
 92+ barTop = $('#bottom').position().top;
 93+
 94+ if (viewportBottom - barHeight >= barTop) {
 95+ $('#bottom-bar').addClass('inplace');
 96+ } else {
 97+ $('#bottom-bar').removeClass('inplace');
 98+ }
 99+ });
 100+
85101 $embed.bind('embed:resize', function(event, data) {
86102 $embed.height(data.height);
 103+ $(window).trigger('scroll');
87104 });
88105 $embed.bind('embed:click', function(event, data) {
89106 // toggle the floating state
@@ -118,50 +135,11 @@
119136 $('.bar').toggleClass('bar-float');
120137 });
121138
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 -
138139 app.loadPage('While My Guitar Gently Weeps');
139140 },
140141
141142 loadPage: function(title) {
142143 ui.startSpinner();
143 - /*
144 - wiki.api({
145 - action: 'query',
146 - prop: 'revisions',
147 - titles: title,
148 - rvprop: 'timestamp|content',
149 - rvparse: 1
150 - }).then(function(data) {
151 - console.log('page!', data);
152 - var pageId, page;
153 - $.each(data.query.pages, function() {
154 - pageId = this.id;
155 - page = this;
156 - });
157 - var revId, rev;
158 - $.each(page.revisions, function() {
159 - revId = this.revid;
160 - rev = this;
161 - });
162 - ui.showPage(page.title, rev['*']);
163 - ui.stopSpinner();
164 - });
165 - */
166144 embed.loadPage(title).then(function() {
167145 ui.stopSpinner();
168146 });
Index: trunk/mockups/athena/frame-inner.js
@@ -76,11 +76,15 @@
7777
7878 // Send generic unhandled taps up to parent
7979 // May need to show/hide toolbars etc
80 -document.addEventListener('click', function(event) {
 80+/*
 81+// doesn't trigger on generic background bits, haven't got it working with touch events yet
 82+// also triggers when clicking buttons and sections which is wrong!
 83+document.documentElement.addEventListener('click', function(event) {
8184 messageParent({
8285 event: 'click'
8386 });
8487 }, false);
 88+*/
8589
8690 })();
8791

Status & tagging log