working on limit parameter

This commit is contained in:
Sacha Greif 2015-07-08 16:23:12 +09:00
parent d8d28fd28e
commit 92d44bf445
2 changed files with 3 additions and 3 deletions

View file

@ -11,7 +11,7 @@ var getDays = function (daysCount) {
return daysArray;
};
FastRender.route('/daily/:days?',function (params) {
FastRender.route('/daily/:daysCount?',function (params) {
var fr = this;
var daysCount = params.daysCount ? params.daysCount : daysPerPage;

View file

@ -14,7 +14,7 @@ Template.posts_list_controller.onCreated(function () {
// initialize the reactive variables
instance.terms = new ReactiveVar(instance.data.terms);
instance.postsLimit = new ReactiveVar(Settings.get('postsPerPage', 10));
instance.postsLimit = new ReactiveVar(instance.data.terms.limit || Settings.get('postsPerPage', 10));
instance.ready = new ReactiveVar(false);
// if caching is set to true, use Subs Manager. Else use template.subscribe. Default to false
@ -27,7 +27,7 @@ Template.posts_list_controller.onCreated(function () {
instance.autorun(function () {
// add a dependency on data context to trigger the autorun
var terms = Template.currentData().terms; // ⚡ reactive ⚡
instance.postsLimit.set(Settings.get('postsPerPage', 10));
instance.postsLimit.set(instance.data.terms.limit || Settings.get('postsPerPage', 10));
});
// Autorun 2: will re-run when limit or terms are changed