Skip to content

Commit 8a91bc7

Browse files
committed
Make sure 'Load More' stories group correctly
1 parent 43f12bd commit 8a91bc7

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

client/javascripts/components/modules/loadStories.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,23 @@ JS.Modules.LoadStories = (function() {
3737

3838
var _appendStories = function(data) {
3939
var stories = data.flow,
40+
lastDay = _settings.$button.data('last-day'),
4041
markup = '';
4142

4243
for (group in stories) {
4344

44-
markup +=
45-
'<li class="list-item list-item--header bdrbl pbs">' +
46-
'<span class="mrs por pot2n">' +
47-
'<span class="srt">calendar</span>' +
48-
'<svg class="icon" width="16" height="16">' +
49-
'<use xlink:href="#icon-calendar"></use>' +
50-
'</svg>' +
51-
'</span>' +
52-
'<span>' + group + '</span>' +
53-
'</li>';
45+
if ( lastDay !== group ) {
46+
markup +=
47+
'<li class="list-item list-item--header bdrbl pbs">' +
48+
'<span class="mrs por pot2n">' +
49+
'<span class="srt">calendar</span>' +
50+
'<svg class="icon" width="16" height="16">' +
51+
'<use xlink:href="#icon-calendar"></use>' +
52+
'</svg>' +
53+
'</span>' +
54+
'<span>' + group + '</span>' +
55+
'</li>';
56+
}
5457

5558
stories[group].forEach(function(story) {
5659
markup +=
@@ -132,7 +135,7 @@ JS.Modules.LoadStories = (function() {
132135
var isMoreStories = data.more;
133136

134137
if (!isMoreStories) {
135-
_settings.$button.addClass(_settings.hiddenClass);
138+
_settings.$button.parent().addClass(_settings.hiddenClass);
136139
}
137140
};
138141

client/stylesheets/foundation/_tools.sass

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
border-bottom: $b-border !important
4141
.bdrbl
4242
border-bottom: $b-border-l !important
43+
.bdrtl
44+
border-top: $b-border-l !important
4345

4446
// -------------------------------------
4547
// Display

views/news/index.jade

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ block content
4141

4242
a.btn.btn--a.db.dib--s.fr--l(href='/news/new') New Post
4343

44-
.js-loadFeed
45-
ul.list.list--l.list--divided.list--divided--l.bdrbl.mbl.pbxl.js-loadFeed-list
44+
.mbxl.js-loadFeed
45+
ul.list.list--l.list--divided.list--divided--l.js-loadFeed-list
4646

4747
- for group, title in flow_collection
4848

@@ -76,8 +76,8 @@ block content
7676
p.mbf= story.body
7777

7878
if more
79-
.well.well--l.mbl.mbxl--m.tac
80-
button.btn.js-loadFeed-btn Load More
79+
.well.well--l.mbl.mbxl--m.bdrtl.ptl.tac
80+
button.btn.js-loadFeed-btn(data-last-day=lastDay) Load More
8181

8282
.g-b.g-b--m--2of5.sector.sector--b
8383
.well.well--l.well--m--xl

0 commit comments

Comments
 (0)