Skip to content

Commit

Permalink
Do not use columns for long articles
Browse files Browse the repository at this point in the history
If long articles use columns, it forces the user to scroll up and down
repeatedly.

This was originally introduced in a7f2490 but
later reverted for reasons unknown in 42e0ed4.

Let’s re-add the condition and also centre the body for nicer experience.
  • Loading branch information
jtojnar committed Jan 25, 2019
1 parent d344dc4 commit cfd1a36
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### New features
- Thumbnails can be disabled ([#897](https://github.com/SSilence/selfoss/pull/897))
- Reddit spout replaced fragile imgur heuristics with previews provided by the JSON API ([#1033](https://github.com/SSilence/selfoss/pull/1033))
- Long articles will no longer be arranged into columns, allowing for smoother reading experience ([#1081](https://github.com/SSilence/selfoss/pull/1081))

### Bug fixes
- Reddit spout allows wider range of URLs, including absolute URLs and searches ([#1033](https://github.com/SSilence/selfoss/pull/1033))
Expand Down
1 change: 1 addition & 0 deletions public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ body * {
-webkit-column-count: 1;
column-count: 1;
max-width: 750px;
margin: auto;
}

.entry-content pre, .entry-content table {
Expand Down
5 changes: 5 additions & 0 deletions public/js/selfoss-events-entries.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ selfoss.events.entries = function() {
if ($('#config').data('scroll_to_article_header') == '1') {
parent.get(0).scrollIntoView();
}

// turn of column view if entry is too long
if (entryContent.height() > $(window).height()) {
entryContent.addClass('entry-content-nocolumns');
}
}

// load images not on mobile devices
Expand Down

0 comments on commit cfd1a36

Please sign in to comment.