Skip to content
Snippets Groups Projects
Commit b517261c authored by Aleix Quintana's avatar Aleix Quintana Committed by Sven Decabooter
Browse files

Issue #3399513 by aleix, domosapiens, wilfred waltman, kopeboy: Scroll_smooth_offset is not working

parent f7b94643
Branches
Tags
1 merge request!10Add scroll_smooth_offset and headings_offset
Pipeline #452559 passed with warnings
......@@ -18,6 +18,8 @@ collapse_depth: '0'
ordered_list: 0
scroll_smooth: 1
scroll_smooth_duration: '420'
scroll_smooth_offset: 0
headings_offset: 1
throttle_timeout: '50'
position_fixed_selector: '.js-toc-block'
position_fixed_class: is-position-fixed
......
......@@ -172,6 +172,18 @@ class SettingsForm extends ConfigFormBase {
'#default_value' => $settings->get('scroll_smooth_duration'),
'#description' => $this->t('Smooth scroll duration.'),
];
$form['tocbot_js_settings']['scroll_smooth_offset'] = [
'#type' => 'number',
'#title' => $this->t('scrollSmoothOffset (number)'),
'#default_value' => $settings->get('scroll_smooth_offset'),
'#description' => $this->t('Smooth scroll offset.'),
];
$form['tocbot_js_settings']['headings_offset'] = [
'#type' => 'number',
'#title' => $this->t('headingsOffset (number)'),
'#default_value' => $settings->get('headings_offset'),
'#description' => $this->t('Headings offset.'),
];
$form['tocbot_js_settings']['throttle_timeout'] = [
'#type' => 'textfield',
'#title' => $this->t('throttleTimeout (number)'),
......
......@@ -33,6 +33,8 @@ class TocbotHelper {
'ordered_list' => 'orderedList',
'scroll_smooth' => 'scrollSmooth',
'scroll_smooth_duration' => 'scrollSmoothDuration',
'scroll_smooth_offset' => 'scrollSmoothOffset',
'headings_offset' => 'headingsOffset',
'throttle_timeout' => 'throttleTimeout',
'position_fixed_selector' => 'positionFixedSelector',
'position_fixed_class' => 'positionFixedClass',
......
......@@ -10,16 +10,16 @@ drupal.tocbot:
- core/jquery
external.tocbot:
remote: https://tscanlin.github.io/tocbot/
version: 4.12.2
version: 4.32.2
license:
name: MIT
url: http://tscanlin.github.io/tocbot/#license
gpl-compatible: true
js:
https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.12.2/tocbot.min.js : { type: external, minified: true }
https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.32.2/tocbot.min.js : { type: external, minified: true }
css:
component:
https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.12.2/tocbot.css : { type: external, minified: true }
https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.32.2/tocbot.css : { type: external, minified: true }
internal.tocbot:
js:
/libraries/tocbot/dist/tocbot.min.js : { minified: true }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment