summaryrefslogtreecommitdiff
path: root/addons/website/static/src/snippets/s_table_of_content
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2020-07-10 14:11:32 +0000
committerqsm-odoo <qsm@odoo.com>2020-07-14 14:43:16 +0000
commit20249d316edc4a9deb3d379587e072a413acd0a2 (patch)
treecf6ebd2e87b5e7d3511ed6d334872d984f90867d /addons/website/static/src/snippets/s_table_of_content
parentb4ce6fbc01e9c49bfc00a64627a4ac1fac2c9ab2 (diff)
[IMP] website: remove animate scrolling option for table of content
Part of https://github.com/odoo/odoo/pull/53930 task-2157252
Diffstat (limited to 'addons/website/static/src/snippets/s_table_of_content')
-rw-r--r--addons/website/static/src/snippets/s_table_of_content/options.js35
1 files changed, 1 insertions, 34 deletions
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
@@ -29,22 +28,6 @@ options.registry.TableOfContent = options.Class.extend({
},
//--------------------------------------------------------------------------
- // 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({