diff --git a/source/js/slider.js b/source/js/slider.js index f8ce30ba6..4fab12b8e 100644 --- a/source/js/slider.js +++ b/source/js/slider.js @@ -60,7 +60,6 @@ export default class Slider { if (e.target.closest("button").getAttribute(this.BTN) === 'prev') { newIndex = this.prevIndex(this.getCurrentIndex(this.SLIDER)) - } else if (e.target.closest("button").getAttribute(this.BTN) === 'next') { newIndex = this.nextIndex(this.getCurrentIndex(this.SLIDER)) } @@ -209,6 +208,7 @@ export default class Slider { const controls = this.SLIDER.querySelectorAll('.c-slider__button'); this.SLIDER.querySelector('[js-slider__stepper]').remove(); + this.SLIDER.classList.remove('c-slider--has-stepper'); controls.forEach(control => { control.remove(); diff --git a/source/sass/component/_slider.scss b/source/sass/component/_slider.scss index 9f5bcb51e..89765fe0f 100644 --- a/source/sass/component/_slider.scss +++ b/source/sass/component/_slider.scss @@ -1,7 +1,10 @@ .c-slider { position: relative; border-radius: $border-radius-md; - margin-bottom: map-get($spacers, "7"); + + &--has-stepper { + margin-bottom: map-get($spacers, "7"); + } &__shadow { @include shadow(2); diff --git a/views/pages/components/usage/slider/single_slide.blade.php b/views/pages/components/usage/slider/single_slide.blade.php new file mode 100644 index 000000000..601436575 --- /dev/null +++ b/views/pages/components/usage/slider/single_slide.blade.php @@ -0,0 +1,18 @@ +@slider([ + 'showStepper' => true, + 'autoSlide' => false, +]) + @slider__item([ + 'title' => 'Base Layout', + 'sub_title' => 'This is a slightly longer title called subtitle', + 'text' => 'Here I could put some lorem ipsum text but I am too lazy to Google for one so I wrote all this instead. Woo!', + 'layout' => 'center', + 'containerColor' => 'transparent', + 'textColor' => 'white', + 'mobile_image' => 'https://picsum.photos/720/720', + 'desktop_image' => 'https://picsum.photos/1080/720', + 'heroStyle' => true + ]) + @endslider__item + +@endslider diff --git a/views/pages/components/usage/slider/slider.json b/views/pages/components/usage/slider/slider.json index 77bcae503..26a969008 100644 --- a/views/pages/components/usage/slider/slider.json +++ b/views/pages/components/usage/slider/slider.json @@ -10,5 +10,11 @@ "heading": "Different Sizes", "subHeading" : "Card is based on a paper component", "text": "This is a default colored button and it's pretty sweet" + }, + "single_slide": { + "grid": "", + "heading": "Single slide", + "subHeading" : "", + "text": "" } } \ No newline at end of file