Browse Source

UPDT version

pull/1066/head
Angel Moya Pardo 7 years ago
committed by Jairo Llopis
parent
commit
accdc4cf85
No known key found for this signature in database GPG Key ID: 59564BF1E22F314F
  1. 2
      web_responsive/__manifest__.py
  2. 28
      web_responsive/static/src/js/web_responsive.js
  3. 35
      web_responsive/static/src/less/main.less
  4. 2
      web_responsive/views/web.xml

2
web_responsive/__manifest__.py

@ -6,7 +6,7 @@
"name": "Web Responsive", "name": "Web Responsive",
"summary": "It provides a mobile compliant interface for Odoo Community " "summary": "It provides a mobile compliant interface for Odoo Community "
"web", "web",
"version": "10.0.1.1.0",
"version": "11.0.1.0.0",
"category": "Website", "category": "Website",
"website": "https://laslabs.com/", "website": "https://laslabs.com/",
"author": "LasLabs, Tecnativa, Odoo Community Association (OCA)", "author": "LasLabs, Tecnativa, Odoo Community Association (OCA)",

28
web_responsive/static/src/js/web_responsive.js

@ -24,10 +24,12 @@ odoo.define('web_responsive', function(require) {
*/ */
open_menu: function(id, allowOpen) { open_menu: function(id, allowOpen) {
this._super(id); this._super(id);
if (allowOpen) return;
if (allowOpen) {
return;
};
var $clicked_menu = this.$secondary_menus.find('a[data-menu=' + id + ']'); var $clicked_menu = this.$secondary_menus.find('a[data-menu=' + id + ']');
$clicked_menu.parents('.oe_secondary_submenu').css('display', ''); $clicked_menu.parents('.oe_secondary_submenu').css('display', '');
},
}
}); });
@ -35,8 +37,8 @@ odoo.define('web_responsive', function(require) {
// Prevent focus of search field on mobile devices // Prevent focus of search field on mobile devices
toggle_visibility: function(is_visible) { toggle_visibility: function(is_visible) {
$('div.oe_searchview_input').last()
.one('focus', $.proxy(this.preventMobileFocus, this));
$('div.oe_searchview_input').last().one(
'focus', $.proxy(this.preventMobileFocus, this));
return this._super(is_visible); return this._super(is_visible);
}, },
@ -55,8 +57,7 @@ odoo.define('web_responsive', function(require) {
} catch (ex) { } catch (ex) {
return false; return false;
} }
},
}
}); });
var AppDrawer = Class.extend({ var AppDrawer = Class.extend({
@ -82,7 +83,7 @@ odoo.define('web_responsive', function(require) {
'down': this.DOWN, 'down': this.DOWN,
'pagedown': this.DOWN, 'pagedown': this.DOWN,
'+': this.RIGHT, '+': this.RIGHT,
'-': this.LEFT,
'-': this.LEFT
}; };
this.initDrawer(); this.initDrawer();
var $clickZones = $('.odoo_webclient_container, ' + var $clickZones = $('.odoo_webclient_container, ' +
@ -103,7 +104,7 @@ odoo.define('web_responsive', function(require) {
this.$el.one('drawer.opened', $.proxy(this.onDrawerOpen, this)); this.$el.one('drawer.opened', $.proxy(this.onDrawerOpen, this));
this.$el.on('drawer.opened', function setIScrollProbes() { this.$el.on('drawer.opened', function setIScrollProbes() {
var onIScroll = function() { var onIScroll = function() {
var transform = (this.iScroll.y) ? this.iScroll.y * -1 : 0;
var transform = this.iScroll.y ? this.iScroll.y * -1 : 0;
$(this).find('#appDrawerAppPanelHead').css( $(this).find('#appDrawerAppPanelHead').css(
'transform', 'matrix(1, 0, 0, 1, 0, ' + transform + ')' 'transform', 'matrix(1, 0, 0, 1, 0, ' + transform + ')'
); );
@ -141,7 +142,7 @@ odoo.define('web_responsive', function(require) {
this.directionCodes[directionCode] this.directionCodes[directionCode]
); );
this.selectAppLink($link); this.selectAppLink($link);
} else if ($.hotkeys.specialKeys[e.keyCode.toString()] == 'esc') {
} else if ($.hotkeys.specialKeys[e.keyCode.toString()] === 'esc') {
this.handleClickZones(); this.handleClickZones();
} else { } else {
var buffer = this.handleKeyBuffer(e.keyCode); var buffer = this.handleKeyBuffer(e.keyCode);
@ -273,14 +274,14 @@ odoo.define('web_responsive', function(require) {
function filterWithin(left, right) { function filterWithin(left, right) {
return function() { return function() {
var $this = $(this), var $this = $(this),
thisMiddle = $this.offset().left + ($this.width() / 2);
thisMiddle = $this.offset().left + $this.width() / 2;
return thisMiddle >= left && thisMiddle <= right; return thisMiddle >= left && thisMiddle <= right;
}; };
} }
var left = $obj.offset().left, var left = $obj.offset().left,
right = left + $obj.outerWidth(); right = left + $obj.outerWidth();
return $grid.filter(filterWithin(left, right)); return $grid.filter(filterWithin(left, right));
},
}
}); });
@ -294,9 +295,8 @@ odoo.define('web_responsive', function(require) {
get_default_view: function() { get_default_view: function() {
var default_view = this._super() var default_view = this._super()
if (config.device.size_class <= config.device.SIZES.XS && if (config.device.size_class <= config.device.SIZES.XS &&
default_view.type != 'kanban' &&
this.views['kanban'])
{
default_view.type !== 'kanban' &&
this.views.kanban) {
default_view.type = 'kanban'; default_view.type = 'kanban';
}; };
return default_view; return default_view;

35
web_responsive/static/src/less/main.less

@ -50,20 +50,51 @@ main {
overflow: auto; overflow: auto;
> .o_main_content { > .o_main_content {
overflow: initial; overflow: initial;
@media (max-width: @screen-xs-max) {
> .o_content { > .o_content {
@media (max-width: @screen-xs-max) {
overflow: initial; overflow: initial;
} }
@media (min-width: @screen-sm-min) {
// .o_content is the one to display horizontal scrolling in
// case of wide tables
.table-responsive {
overflow-x: visible;
}
}
} }
} }
} }
} }
// Remove z-index from CP buttons so it doesn't overlap the menu
@media (max-width: @screen-sm-max) {
.o_control_panel { .o_control_panel {
// Remove z-index from CP buttons so it doesn't overlap the menu
.btn-group > .btn.active { .btn-group > .btn.active {
z-index: initial; z-index: initial;
} }
// Better horizontal space usage for buttons
justify-content: space-between;
.o_cp_left, .o_cp_right {
width: inherit;
}
.o_search_options > .o_dropdown {
&.hidden-xs {
// No other way to display "Group By" button :(
display: inline-block !important;
}
// Hack to hide text and display larger icons
> .btn {
font-size: 0;
> .fa {
font-size: @odoo-font-size-base * 1.4;
}
}
}
}
} }
.o_chat_window { .o_chat_window {

2
web_responsive/views/web.xml

@ -12,7 +12,7 @@
name="App Drawer - Web Client" name="App Drawer - Web Client"
> >
<xpath expr="//div[@class='o_sub_menu']" position="replace" />
<xpath expr="//div[@contains('class', 'o_sub_menu')]" position="replace" />
<xpath expr="//t[@t-set='head']" position="inside"> <xpath expr="//t[@t-set='head']" position="inside">
<meta charset="utf-8" /> <meta charset="utf-8" />

Loading…
Cancel
Save