mirror of
https://github.com/vale981/Vulcan
synced 2025-03-08 19:11:38 -05:00
working on limit parameter
This commit is contained in:
parent
d8d28fd28e
commit
92d44bf445
2 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue