diff --git a/addons/website/static/src/snippets/s_table_of_content/options.js b/addons/website/static/src/snippets/s_table_of_content/options.js index 2e3d533e92d..0aae9030dab 100644 --- a/addons/website/static/src/snippets/s_table_of_content/options.js +++ b/addons/website/static/src/snippets/s_table_of_content/options.js @@ -11,7 +11,6 @@ options.registry.TableOfContent = options.Class.extend({ this.targetedElements = 'h1, h2'; const $headings = this.$target.find(this.targetedElements); if ($headings.length > 0) { - this.isAnimateScrolling = this.$target.find(this.targetedElements)[0].dataset.anchor === 'true' ? true : false; this._generateNav(); } // Generate the navbar if the content changes @@ -28,22 +27,6 @@ options.registry.TableOfContent = options.Class.extend({ this._generateNav(); }, - //-------------------------------------------------------------------------- - // Options - //-------------------------------------------------------------------------- - - /** - * Animate (or not) scrolling. - * - * @see this.selectClass for parameters - */ - animateScrolling: function (previewMode, widgetValue, params) { - const $headings = this.$target.find(this.targetedElements); - const anchorValue = widgetValue ? 'true' : '0'; - _.each($headings, el => el.dataset.anchor = anchorValue); - this.isAnimateScrolling = !!widgetValue; - }, - //-------------------------------------------------------------------------- // Private //-------------------------------------------------------------------------- @@ -63,26 +46,10 @@ options.registry.TableOfContent = options.Class.extend({ .text($el.text()) .appendTo($nav); $el.attr('id', id); - $el[0].dataset.anchor = this.isAnimateScrolling === true ? 'true' : '0'; + $el[0].dataset.anchor = 'true'; }); $nav.find('a:first').addClass('active'); }, - /** - * @override - */ - _computeWidgetState: function (methodName, params) { - switch (methodName) { - case 'animateScrolling': { - const $headings = this.$target.find(this.targetedElements); - if ($headings.length > 0) { - return $headings[0].dataset.anchor === 'true' ? 'true' : '0'; - } else { - return 'true'; - } - } - } - return this._super(...arguments); - }, }); options.registry.TableOfContentNavbar = options.Class.extend({ diff --git a/addons/website/views/snippets/s_table_of_content.xml b/addons/website/views/snippets/s_table_of_content.xml index 288493da2aa..a0dfa8fc88b 100644 --- a/addons/website/views/snippets/s_table_of_content.xml +++ b/addons/website/views/snippets/s_table_of_content.xml @@ -50,9 +50,7 @@