Commit 5357625a authored by git's avatar git Committed by NickWilde

Issue #2926311 by h3rj4n, israelshmueli, tibezh, Gtucker6, sitiveni, sakiland,...

Issue #2926311 by h3rj4n, israelshmueli, tibezh, Gtucker6, sitiveni, sakiland, dww: Notice: Undefined index: views_slideshow_pager_bullets
parent 6be7cdc4
......@@ -15,4 +15,36 @@ use Drupal\views_slideshow\ViewsSlideshowWidgetBase;
* )
*/
class PagerBullets extends ViewsSlideshowWidgetBase {
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
return [
'views_slideshow_pager_bullets_hover' => ['default' => 0],
];
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
// Add field to see if they would like to activate slide and pause on pager
// hover.
$form['views_slideshow_pager_bullets_hover'] = [
'#type' => 'checkbox',
'#title' => $this->t('Activate Slide and Pause on Pager Hover'),
'#default_value' => $this->getConfiguration()['views_slideshow_pager_bullets_hover'],
'#description' => $this->t('Should the slide be activated and paused when hovering over a pager item.'),
'#states' => [
'visible' => [
':input[name="' . $this->getConfiguration()['dependency'] . '[enable]"]' => ['checked' => TRUE],
':input[name="' . $this->getConfiguration()['dependency'] . '[type]"]' => ['value' => 'views_slideshow_pager_bullets'],
],
],
];
return $form;
}
}
......@@ -292,7 +292,7 @@ function template_preprocess_views_slideshow_pager_bullets(&$vars) {
$vars['#attached']['library'][] = 'views_slideshow/pager_bullets';
$vars['#attached']['drupalSettings']['viewsSlideshowPagerFields'][$vars['vss_id']] = [
$vars['location'] => [
'activatePauseOnHover' => $vars['settings']['views_slideshow_pager_bullets']['views_slideshow_pager_bullets_hover'],
'activatePauseOnHover' => $vars['settings']['views_slideshow_pager_bullets']['views_slideshow_pager_bullets_hover'] ?? '',
],
];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment