1
- /** @odoo -module **/
1
+ import { SnippetOption } from "@web_editor/js/editor/snippets.options" ;
2
2
3
- import options from "@web_editor/js/editor/snippets.options.legacy" ;
4
-
5
- options . registry . MediaItemLayout = options . Class . extend ( {
3
+ // FIXME: this is unused (no option definition in mass_mailing),
4
+ // see addons/website/static/src/snippets/s_media_list/options.js
5
+ // This is never attached to any snippet (no selector).
6
+ export class MediaItemLayout extends SnippetOption {
6
7
7
8
//--------------------------------------------------------------------------
8
9
// Options
@@ -13,7 +14,7 @@ options.registry.MediaItemLayout = options.Class.extend({
13
14
*
14
15
* @see this.selectClass for parameters
15
16
*/
16
- layout : function ( previewMode , widgetValue , params ) {
17
+ layout ( previewMode , widgetValue , params ) {
17
18
const $image = this . $target . find ( '.s_media_list_img_wrapper' ) ;
18
19
const $content = this . $target . find ( '.s_media_list_body' ) ;
19
20
@@ -23,7 +24,7 @@ options.registry.MediaItemLayout = options.Class.extend({
23
24
}
24
25
$image . addClass ( `col-lg-${ widgetValue } ` ) ;
25
26
$content . addClass ( `col-lg-${ 12 - widgetValue } ` ) ;
26
- } ,
27
+ }
27
28
28
29
//--------------------------------------------------------------------------
29
30
// Private
@@ -32,7 +33,7 @@ options.registry.MediaItemLayout = options.Class.extend({
32
33
/**
33
34
* @override
34
35
*/
35
- _computeWidgetState ( methodName , params ) {
36
+ async _computeWidgetState ( methodName , params ) {
36
37
switch ( methodName ) {
37
38
case 'layout' : {
38
39
const $image = this . $target . find ( '.s_media_list_img_wrapper' ) ;
@@ -43,6 +44,6 @@ options.registry.MediaItemLayout = options.Class.extend({
43
44
}
44
45
}
45
46
}
46
- return this . _super ( ...arguments ) ;
47
- } ,
48
- } ) ;
47
+ return super . _computeWidgetState ( ...arguments ) ;
48
+ }
49
+ }
0 commit comments