MMM-Carousel icon indicating copy to clipboard operation
MMM-Carousel copied to clipboard

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

Open paulsp opened this issue 2 years ago • 3 comments

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.

https://github.com/shbatm/MMM-Carousel/blob/22b64b2aa686b6d3c1972aef770be64082dd5f89/MMM-Carousel.js#L363-L369

paulsp avatar May 30 '22 20:05 paulsp

Related to #34

shbatm avatar May 30 '22 23:05 shbatm

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
						]
				]
			}
		}
	]

paulsp avatar May 31 '22 10:05 paulsp

the fix on line 368 seemed to work for me

asgillmor avatar Oct 29 '22 03:10 asgillmor