mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Merge pull request #3816 from felixrieseberg/iss3671
'Autocorrect' for posts per page setting
This commit is contained in:
commit
71e97a20e6
2 changed files with 7 additions and 1 deletions
|
@ -38,6 +38,12 @@ var SettingsGeneralController = Ember.ObjectController.extend({
|
|||
self.notifications.showErrors(errors);
|
||||
});
|
||||
},
|
||||
|
||||
checkPostsPerPage: function () {
|
||||
if (this.get('postsPerPage') < 1 || this.get('postsPerPage') > 1000 || isNaN(this.get('postsPerPage'))) {
|
||||
this.set('postsPerPage', 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
|
||||
<div class="form-group">
|
||||
<label for="postsPerPage">Posts per page</label>
|
||||
{{input id="postsPerPage" name="general[postsPerPage]" value=postsPerPage min="1" max="1000" type="number"}}
|
||||
{{input id="postsPerPage" name="general[postsPerPage]" focus-out="checkPostsPerPage" value=postsPerPage min="1" max="1000" type="number"}}
|
||||
<p>How many posts should be displayed on each page</p>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue