From 943f66c1c60c41c56b8ef0066478b69251f9048f Mon Sep 17 00:00:00 2001 From: Geo Halkiadakis Date: Tue, 26 Nov 2024 11:57:19 +0200 Subject: impelement base_url and points of interest feature --- demos/scripts/slidetray.js | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'demos/scripts') diff --git a/demos/scripts/slidetray.js b/demos/scripts/slidetray.js index 7c32f5b..ffe5847 100644 --- a/demos/scripts/slidetray.js +++ b/demos/scripts/slidetray.js @@ -8,13 +8,13 @@ define([ const presentation = (setup) => { let factory = { - setup: { /** @object : slidetray paramaters */ }, + setup: { /** @object : slidetray parameters */ }, features: [], defaults: { selector: '.slidetray', - source_url: '', + base_url: '', effect: 'none', theme: 'light', navigation: true, @@ -77,34 +77,35 @@ define([ prepare: function() { // prepare slides and css let html = []; let css = []; - + if (this.setup.hasOwnProperty('css')) { css.push(this.setup.css); } - + this.setup.slides.forEach( (slide, i) => { - slideHtml = ` + let slideHtml = `
- + `; if (slide.poi && Array.isArray(slide.poi)) { - let slideClass = `f-${i}-${j}`; + slide.poi.forEach( (poi, j) => { - - if (poi.link) { + let slideClass = `f-${i}-${j}`; + + if (poi.link) { // link html slideHtml += ``; - + } else { - slideHtml += `
+ slideHtml += `
${poi.text}
`; } - - if (poi.style) { + + if (poi.style) { // link css poi.style.forEach( rs => { // ruleset - css.push(`.${slideClass} ${rs}`); + css.push(`.${slideClass}${rs}`); }); } }) @@ -114,7 +115,7 @@ define([ }); this.presentation.html = html.join('\n'); this.presentation.css = css.join('\n'); - + return this; }, -- cgit v1.2.3