Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only the first carouselId is displayed on a slide for a unique module. #36

Open
paulsp opened this issue May 30, 2022 · 3 comments
Open

Comments

@paulsp
Copy link

paulsp commented May 30, 2022

slides: [ [
               {name:'MMM-SimpleText', carouselId: '1.3'},
               {name:'MMM-SimpleText', carouselId: '1.4'},
               ]
             ]

Will only display carouselId: '1.3'. If the break is change to continue both 1.3 and 1.4 will be displayed.

if (
typeof mods[s].carouselId !== "undefined" &&
typeof this[i].data.config.carouselId !== "undefined" &&
mods[s].carouselId !== this[i].data.config.carouselId
) {
break;
}

@shbatm
Copy link
Owner

shbatm commented May 30, 2022

Related to #34

@paulsp
Copy link
Author

paulsp commented May 31, 2022

The following config.js snipit works as expected with the above mentioned fix.

	modules: [
		{
			module: 'helloworld',
			position: 'center_middle',
			config: {
				carouselId: 'section-1-header',
				text: 'Section 1'
			}
		},
		{
			module: 'helloworld',
			position: 'center_middle',
			config: {
				carouselId: 'section-1-detail',
				text: 'Detail Line 1.1'
			}
		},
		{
			module: 'helloworld',
			position: 'center_middle',
			config: {
				carouselId: 'section-1-detail',
			position: 'center_middle',
			config: {
				carouselId: 'section-1-detail',
				text: 'Detail Line 1.2'
			}
		},
		{
			module: 'helloworld',
			position: 'center_middle',
			config: {
				carouselId: 'section-2-header',
				text: 'Section 2'
			}
		},
		{
			module: 'helloworld',
			position: 'center_middle',
			config: {
				carouselId: 'section-2-detail',
				text: 'Detail Line 2.1'
			}
		},
		{
			module: 'helloworld',
			position: 'center_middle',
			config: {
				carouselId: 'section-2-detail',
				text: 'Detail Line 2.2'
			}
		},
		{
			module: 'MMM-Carousel',
			position: 'bottom_bar',
			config: {
				mode: 'slides',
				slides: [
						[
						{name:'helloworld', carouselId: 'section-1-header'}, // Expect 1 line
						{name:'helloworld', carouselId: 'section-1-detail'}, // Expect 2 lines
						{name:'helloworld', carouselId: 'section-2-header'}, // Expect 1 line
						{name:'helloworld', carouselId: 'section-2-detail'}, // Expect 2 lines
						{name:'helloworld', carouselId: 'section-2-detail'}, // Expect zero lines as duplicate carouselId in slide
						{name:'helloworld', carouselId: 'section-2-detail'}, // Expect zero lines as duplicate carouselId in slide
						{name:'helloworld', carouselId: 'section-3-header'}, // Expect zero lines as carouselId not defined
						{name:'helloworld', carouselId: 'section-3-detail'}, // Expect zero lines as carouselId not defined
						]
				]
			}
		}
	]

@asgillmor
Copy link

the fix on line 368 seemed to work for me

asgillmor added a commit to asgillmor/MMM-Carousel that referenced this issue Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants