From e7d2a5823b7469f36ba267eb907d0aad6d99a8bc Mon Sep 17 00:00:00 2001 From: Tijn Kersjes Date: Mon, 3 Dec 2018 22:15:06 +0100 Subject: [PATCH 1/2] Pass options down to slide template --- lib/index.js | 3 +++ templates/default.mustache | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/index.js b/lib/index.js index 7e36978..b3b91d1 100644 --- a/lib/index.js +++ b/lib/index.js @@ -212,11 +212,14 @@ Cleaver.prototype.loadStaticAssets = function () { Cleaver.prototype.renderSlideshow = function () { var putControls = this.options.controls || (this.options.controls === undefined); var putProgress = this.options.progress || (this.options.progress === undefined); + var options = Object.assign({}, this.options, { controls: putControls, progress: putProgress }); + var style, script, output; // Render the slides in a template (maybe as specified by the user) var slideshow = mustache.render(this.templates.loaded.slides, { slides: this.slides, + options: options, controls: putControls, progress: putProgress }); diff --git a/templates/default.mustache b/templates/default.mustache index 1d0208f..55dc19f 100644 --- a/templates/default.mustache +++ b/templates/default.mustache @@ -1,8 +1,8 @@ -{{#progress}} +{{#options.progress}}
-{{/progress}} +{{/options.progress}} {{#slides}}
@@ -10,9 +10,9 @@
{{/slides}} -{{#controls}} +{{#options.controls}}
-{{/controls}} +{{/options.controls}} From 6f86bc136b8efcd58b6564ba0a3b296fdf0490f2 Mon Sep 17 00:00:00 2001 From: Tijn Kersjes Date: Mon, 3 Dec 2018 22:32:46 +0100 Subject: [PATCH 2/2] Use the correct default values for controls and progress in the layout --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index b3b91d1..1748128 100644 --- a/lib/index.js +++ b/lib/index.js @@ -258,7 +258,7 @@ Cleaver.prototype.renderSlideshow = function () { style: style, author: this.options.author, script: script, - options: this.options + options: options }; /* Return the rendered slideshow */