Skip to content

Commit

Permalink
Enable autoPlay as opt-in. Documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh committed Mar 7, 2024
1 parent ab4f206 commit b570366
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push]
env:
ADDON_NAME: "@kitconcept/volto-slider-block"
ADDON_PATH: "volto-slider-block"
VOLTO_VERSION: "17.6.0"
VOLTO_VERSION: "17.15.3"

jobs:

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RESET=`tput sgr0`
YELLOW=`tput setaf 3`

PLONE_VERSION=6
VOLTO_VERSION=17.7.0
VOLTO_VERSION=17.15.3

ADDON_NAME='@kitconcept/volto-slider-block'
ADDON_PATH='volto-slider-block'
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ yarn start

Go to http://localhost:3000, login, create a new page. The slider block will show up in the Volto blocks chooser.

## Configuration options

### `enableAutoPlay`

This enables the autoplay controls in the block's settings.

```js
config.blocks.blocksConfig.slider.enableAutoPlay = true;
```

## Upgrade Guide

### `volto-slider-block` 6.0.0
Expand Down
14 changes: 9 additions & 5 deletions src/components/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,15 @@ export const SliderSchema = (props) =>
title: 'Default',
fields: ['slides'],
},
{
id: 'autoplay',
title: props.intl.formatMessage(messages.Autoplay),
fields: ['autoplayEnabled', 'autoplayDelay', 'autoplayJump'],
},
...(config.blocks.blocksConfig.slider.enableAutoPlay
? [
{
id: 'autoplay',
title: props.intl.formatMessage(messages.Autoplay),
fields: ['autoplayEnabled', 'autoplayDelay', 'autoplayJump'],
},
]
: []),
],
properties: {
slides: {
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const applyConfig = (config) => {
mostUsed: true,
sidebarTab: 1,
dataAdapter: SliderBlockDataAdapter,
enableAutoPlay: false,
};
return config;
};
Expand Down

0 comments on commit b570366

Please sign in to comment.