Browse Source
[10.0][IMP] web_responsive: Load default kanban view for small screen
pull/1066/head
Sergio Teruel Albert
8 years ago
committed by
Jairo Llopis
No known key found for this signature in database
GPG Key ID: 59564BF1E22F314F
2 changed files with
21 additions and
0 deletions
-
web_responsive/README.rst
-
web_responsive/static/src/js/web_responsive.js
|
|
@ -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 |
|
|
|
---------- |
|
|
|
|
|
@ -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, |
|
|
|
}; |
|
|
|
|
|
|
|
}); |