FEATURE: posts per page is configurable, so should be desktop slack

This commit is contained in:
Sam 2014-05-31 10:19:29 +10:00
parent acc65ecc15
commit 7861cabfa1
3 changed files with 9 additions and 2 deletions
app/assets/javascripts/discourse/lib
config

View file

@ -19,12 +19,15 @@ Discourse.Capabilities = Ember.Object.extend({
// Touch devices get more slack due to inertia
if (this.get('touch')) { return 1.5; }
var desktopSlack = parseFloat(Discourse.SiteSettings.desktop_post_slack_ratio,10);
desktopSlack = Math.max(desktopSlack,1);
// Higher resolution devices (likely laptops/desktops) should get more slack because they
// can handle the perf.
return this.get('highRes') ? 2.0 : 0.75;
return this.get('highRes') ? desktopSlack : 0.75;
}.property('android', 'touch', 'highRes')
});
Discourse.Capabilities.reopenClass(Discourse.Singleton);
Discourse.Capabilities.reopenClass(Discourse.Singleton);

View file

@ -682,6 +682,7 @@ en:
track_external_right_clicks: "Track external links that are right clicked (eg: open in new tab) disabled by default because it rewrites URLs"
topics_per_page: "How many topics loaded by default on the topics list page, and when loading more topics"
posts_per_page: "How many posts loaded by default on a topic page, and when loading more posts"
desktop_post_slack_ratio: "Number of screens of posts rendered in the DOM on Desktop"
site_contact_username: "Username for the author of automated private messages sent by the forum"
send_welcome_message: "Do new users get a welcome private message?"
suppress_reply_directly_below: "Don't show reply count on a post when there is a single reply directly below"

View file

@ -85,6 +85,9 @@ basic:
posts_per_page:
client: true
default: 20
desktop_post_slack_ratio:
default: 2
client: true
enable_badges:
client: true
default: false