Skip to content

Commit

Permalink
Feed Example: Fix Styling Dependency on table.css (pull #349)
Browse files Browse the repository at this point in the history
For feed example development issue #246, fix styling problems that resulted from removal of examples/css/table.css as described in issue #338.

This fixes infinite scroll FF.
  • Loading branch information
tatermelon authored and mcking65 committed Apr 10, 2017
1 parent b06858a commit 207db41
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
34 changes: 29 additions & 5 deletions examples/feed/css/feedDisplay.css
Original file line number Diff line number Diff line change
@@ -1,21 +1,42 @@
body {
background: #fafafa;
font-family: Helvetica, Arial, sans-serif;
}

#sidepanel {
box-sizing: border-box;
display: inline-block;
padding-left: 1.5em;
vertical-align: top;
width: 29%;
}

#delay-time-select {
display: block;
margin-top: 5px;
width: 10em;
}

#main-content {
display: inline-block;
vertical-align: top;
min-width: 250px;
width: 70%;
}

#restaurant-feed {
margin-top: 30px;
max-width: 100%;
width: 500px;
}

@media screen and (max-width: 560px) {
#main-content {
width: 100%;
}
}

.restaurant-item {
background: white;
box-shadow: 1px 1px 6px #bbb;
margin-bottom: 15px;
padding-top: 15px;
Expand All @@ -26,7 +47,7 @@
margin-bottom: 10px;
padding-left: 15px;
vertical-align: top;
width: 270px;
width: 55%;
}

.restaurant-name {
Expand All @@ -39,19 +60,22 @@
}

.restaurant-type {
color: #999;
color: #777;
font-size: 13px;
}

.location-block {
color: #777;
display: inline-block;
padding-top: 5px;
vertical-align: top;
margin: 0 15px 10px;
font-size: 14px;
line-height: 1.3em;
}

.restaurant-actions {
box-sizing: border-box;
background: #d8d0c5;
background: #a2afbc;
padding: 10px;
width: 100%;
}
2 changes: 1 addition & 1 deletion examples/feed/feedDisplay.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2>Recommended Restaurants</h2>
</div>
</section>
<section id="sidepanel">
Sidepanel goes here
<label for="delay-time-select">Select article loading delay</label>
<select id="delay-time-select" name="delay_time">
<option value="200">200 ms</option>
<option value="400">400 ms</option>
Expand Down
6 changes: 5 additions & 1 deletion examples/feed/js/feedDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,11 @@ aria.FeedDisplay.prototype.checkLoadMore = function () {
}

var lastFeedItem = this.feedItems[this.feedItems.length - 1];
var scrollBottom = document.body.scrollTop + window.innerHeight;
var scrollTop = window.pageYOffset
|| document.documentElement.scrollTop
|| document.body.scrollTop
|| 0;
var scrollBottom = scrollTop + window.innerHeight;

if (scrollBottom >= (lastFeedItem.offsetTop - 300)) {
this.loadData();
Expand Down

0 comments on commit 207db41

Please sign in to comment.