diff --git a/config/schema/views_infinite_scroll.schema.yml b/config/schema/views_infinite_scroll.schema.yml index 75df35b..69b1004 100644 --- a/config/schema/views_infinite_scroll.schema.yml +++ b/config/schema/views_infinite_scroll.schema.yml @@ -11,3 +11,6 @@ views.pager.infinite_scroll: automatically_load_content: type: boolean label: 'Automatically Load Content' + initial: + type: integer + label: 'Initial items' diff --git a/src/Plugin/views/pager/InfiniteScroll.php b/src/Plugin/views/pager/InfiniteScroll.php index 3af17a3..ca1b408 100644 --- a/src/Plugin/views/pager/InfiniteScroll.php +++ b/src/Plugin/views/pager/InfiniteScroll.php @@ -1,6 +1,5 @@ $this->t('Automatically load subsequent pages as the user scrolls.'), '#default_value' => $options['automatically_load_content'], ], - // Initial items count. 'initial' => [ '#type' => 'textfield', '#title' => $this->t('Initial items'), @@ -114,7 +112,7 @@ class InfiniteScroll extends SqlBase { * @param array $complete_form * The complete form structure. */ - public static function validateIntegerPositive(&$element, FormStateInterface $form_state, &$complete_form) { + public static function validateIntegerPositive(array &$element, FormStateInterface $form_state, array &$complete_form) { $value = $element['#value']; if ($value !== '' && (!is_numeric($value) || intval($value) != $value || $value < 0)) { $form_state->setError($element, t('%name must be a positive integer.', array('%name' => $element['#title'])));