[IMP] web: enable action menu on mobile
This commit creates the required hooks to implement this feature. Task ID: 1879566
This commit is contained in:
committed by
Pierre Paridans
parent
e1f605bef8
commit
f9193fa417
@@ -7,6 +7,7 @@ odoo.define('web.ListController', function (require) {
|
||||
* and bind all extra buttons/pager in the control panel.
|
||||
*/
|
||||
|
||||
var config = require('web.config');
|
||||
var core = require('web.core');
|
||||
var BasicController = require('web.BasicController');
|
||||
var DataExport = require('web.DataExport');
|
||||
@@ -636,6 +637,7 @@ var ListController = BasicController.extend({
|
||||
const state = this.model.get(this.handle, {raw: true});
|
||||
this.$selectionBox = $(qweb.render('ListView.selection', {
|
||||
isDomainSelected: this.isDomainSelected,
|
||||
isMobile: config.device.isMobile,
|
||||
isPageSelected: this.isPageSelected,
|
||||
nbSelected: this.selectedRecords.length,
|
||||
nbTotal: state.count,
|
||||
|
||||
@@ -293,6 +293,15 @@ var ListRenderer = BasicRenderer.extend({
|
||||
}),
|
||||
};
|
||||
},
|
||||
/**
|
||||
* Returns the jQuery node used to update the selection
|
||||
*
|
||||
* @private
|
||||
* @return {jQuery}
|
||||
*/
|
||||
_getSelectableRecordCheckboxes: function () {
|
||||
return this.$('tbody .o_list_record_selector input:visible:not(:disabled)');
|
||||
},
|
||||
/**
|
||||
* Adjacent buttons (in the arch) are displayed in a single column. This
|
||||
* function iterates over the arch's nodes and replaces "button" nodes by
|
||||
@@ -1174,7 +1183,7 @@ var ListRenderer = BasicRenderer.extend({
|
||||
_updateSelection: function () {
|
||||
this.selection = [];
|
||||
var self = this;
|
||||
var $inputs = this.$('tbody .o_list_record_selector input:visible:not(:disabled)');
|
||||
var $inputs = this._getSelectableRecordCheckboxes();
|
||||
var allChecked = $inputs.length > 0;
|
||||
$inputs.each(function (index, input) {
|
||||
if (input.checked) {
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
<i t-if="icon" t-att-class="icon"/>
|
||||
<span class="o_dropdown_title" t-esc="title"/>
|
||||
<i t-if="displayCaret" t-attf-class="o_dropdown_caret fa fa-caret-{{ state.open ? 'down' : 'right' }}"/>
|
||||
<i t-elif="displayChevron" t-attf-class="fa fa-chevron-{{ state.open ? 'down' : 'right' }} float-right mt4"/>
|
||||
<i t-elif="displayChevron" t-attf-class="o_dropdown_chevron fa fa-chevron-{{ state.open ? 'down' : 'right' }} float-right mt4"/>
|
||||
</button>
|
||||
<ul t-if="state.open" t-attf-class="o_dropdown_menu dropdown-menu {{ dropdownMenuAlignClass }} show" role="menu"
|
||||
t-on-item-selected="_onItemSelected"
|
||||
|
||||
Reference in New Issue
Block a user