Commit c4be3ce6 authored by osman's avatar osman Committed by osman

Issue #2996603 by osman: Invalid JS options

parent 4b14e0f2
...@@ -53,8 +53,8 @@ function lazy_page_attachments(array &$attachments) { ...@@ -53,8 +53,8 @@ function lazy_page_attachments(array &$attachments) {
$config = \Drupal::config('lazy.settings'); $config = \Drupal::config('lazy.settings');
$options = [ $options = [
'errorClass' => $config->get('errorClass'), 'errorClass' => $config->get('errorClass'),
'loadInvisible' => $config->get('loadInvisible'), 'loadInvisible' => boolval($config->get('loadInvisible')),
'offset' => $config->get('offset'), 'offset' => intval($config->get('offset')),
'saveViewportOffsetDelay' => $config->get('saveViewportOffsetDelay'), 'saveViewportOffsetDelay' => $config->get('saveViewportOffsetDelay'),
'selector' => '.' . $config->get('selector'), 'selector' => '.' . $config->get('selector'),
'skipClass' => $config->get('skipClass'), 'skipClass' => $config->get('skipClass'),
......
...@@ -171,8 +171,8 @@ class LazyForm extends ConfigFormBase { ...@@ -171,8 +171,8 @@ class LazyForm extends ConfigFormBase {
$this->config('lazy.settings') $this->config('lazy.settings')
->set('alter_tag', $form_state->getValue('alter_tag')) ->set('alter_tag', $form_state->getValue('alter_tag'))
->set('errorClass', $form_state->getValue('errorClass')) ->set('errorClass', $form_state->getValue('errorClass'))
->set('loadInvisible', $form_state->getValue('loadInvisible')) ->set('loadInvisible', boolval($form_state->getValue('loadInvisible')))
->set('offset', $form_state->getValue('offset')) ->set('offset', intval($form_state->getValue('offset')))
->set('saveViewportOffsetDelay', $form_state->getValue('saveViewportOffsetDelay')) ->set('saveViewportOffsetDelay', $form_state->getValue('saveViewportOffsetDelay'))
->set('selector', $form_state->getValue('selector')) ->set('selector', $form_state->getValue('selector'))
->set('skipClass', $form_state->getValue('skipClass')) ->set('skipClass', $form_state->getValue('skipClass'))
......
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