summaryrefslogtreecommitdiff
path: root/addons/website/static/src/snippets/s_dynamic_snippet_carousel/000.js
blob: cf43100a8c94e7abc058bb529588bd4d7de27b10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
odoo.define('website.s_dynamic_snippet_carousel', function (require) {
'use strict';

const config = require('web.config');
const core = require('web.core');
const publicWidget = require('web.public.widget');
const DynamicSnippet = require('website.s_dynamic_snippet');

const DynamicSnippetCarousel = DynamicSnippet.extend({
    selector: '.s_dynamic_snippet_carousel',
    xmlDependencies: (DynamicSnippet.prototype.xmlDependencies || []).concat(
        ['/website/static/src/snippets/s_dynamic_snippet_carousel/000.xml']
    ),

    /**
     *
     * @override
     */
    init: function () {
        this._super.apply(this, arguments);
        this.template_key = 'website.s_dynamic_snippet.carousel';
    },

    //--------------------------------------------------------------------------
    // Private
    //--------------------------------------------------------------------------

    /**
     * Method to be overridden in child components in order to prepare QWeb
     * options
     * @private
     */
    _getQWebRenderParams: function () {
        return Object.assign(
            this._super.apply(this, arguments),
            {
                interval : parseInt(this.$target[0].dataset.carouselInterval),
            },
        );
    },

});
publicWidget.registry.dynamic_snippet_carousel = DynamicSnippetCarousel;

return DynamicSnippetCarousel;
});