Browse Source

[10.0][IMP] web_responsive: Load default kanban view for small screen

pull/730/head
Sergio Teruel Albert 8 years ago
committed by sergio.teruel
parent
commit
853ea8eac0
  1. 3
      web_responsive/README.rst
  2. 18
      web_responsive/static/src/js/web_responsive.js

3
web_responsive/README.rst

@ -12,6 +12,7 @@ Features:
* New navigation with an App drawer
* Keyboard shortcuts for easier navigation
* Display kanban views for small screens if an action or field One2x
Installation
@ -53,6 +54,7 @@ this module.
great styles, but also `JavaScript that causes issues on mobile
<https://github.com/OCA/web/pull/446#issuecomment-254827880>`_
Bug Tracker
===========
@ -76,6 +78,7 @@ Contributors
* Dave Lasley <dave@laslabs.com>
* Jairo Llopis <jairo.llopis@tecnativa.com>
* Dennis Sluijk <d.sluijk@onestein.nl>
* Sergio Teruel <sergio.teruel@tecnativa.com>
Maintainer
----------

18
web_responsive/static/src/js/web_responsive.js

@ -8,6 +8,9 @@ odoo.define('web_responsive', function(require) {
var Class = require('web.Class');
var SearchView = require('web.SearchView');
var core = require('web.core');
var config = require('web.config');
var FieldOne2Many = core.form_widget_registry.get('one2many');
var ViewManager = require('web.ViewManager');
Menu.include({
@ -286,10 +289,25 @@ odoo.define('web_responsive', function(require) {
new AppDrawer();
});
// if we are in small screen change default view to kanban if exists
ViewManager.include({
get_default_view: function() {
var default_view = this._super()
if (config.device.size_class <= config.device.SIZES.XS &&
default_view.type != 'kanban' &&
this.views['kanban'])
{
default_view.type = 'kanban';
};
return default_view;
},
});
return {
'AppDrawer': AppDrawer,
'SearchView': SearchView,
'Menu': Menu,
'ViewManager': ViewManager,
};
});
Loading…
Cancel
Save