mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[FIX] web_widget_x2many_2d_matrix: Forced render mode to list on small screens
This commit is contained in:
committed by
Lois Rilo
parent
7d692504dc
commit
9aef7f1019
23
web_widget_x2many_2d_matrix/static/src/js/2d_matrix_view.js
Normal file
23
web_widget_x2many_2d_matrix/static/src/js/2d_matrix_view.js
Normal file
@@ -0,0 +1,23 @@
|
||||
/* Copyright 2019 Alexandre Díaz
|
||||
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
|
||||
|
||||
odoo.define('web_widget_x2many_2d_matrix.X2Many2dMatrixView', function (require) {
|
||||
"use strict";
|
||||
|
||||
var BasicView = require('web.BasicView');
|
||||
|
||||
BasicView.include({
|
||||
init: function (viewInfo) {
|
||||
// Force mode='list'
|
||||
var $arch = $(viewInfo.arch);
|
||||
var selector = "field[widget='x2many_2d_matrix']";
|
||||
$arch.find(selector).each(function (i, e) {
|
||||
$(e).attr('mode', 'list');
|
||||
});
|
||||
viewInfo.arch = $arch.prop('outerHTML');
|
||||
|
||||
this._super.apply(this, arguments);
|
||||
},
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user