Browse Source

[FIX] web_responsive: Fix several issues

* one2many tags now not hidden behind inputs.
* Drawer icons now with much better look.
* No overflow bug in small views when closing drawer.
* Documented it when resizing viewport. (+1 squashed commit)
* Whitespace cleanup.
pull/396/head
Jairo Llopis 8 years ago
committed by Dave Lasley
parent
commit
11e44ef265
  1. 2
      web_app_drawer/README.rst
  2. 2
      web_app_drawer/static/src/js/web_app_drawer.js
  3. 11
      web_app_drawer/static/src/less/app_drawer.less
  4. 10
      web_app_drawer/static/src/less/main.less
  5. 7
      web_app_drawer/static/src/less/navbar.less
  6. 4
      web_app_drawer/static/src/less/variables.less
  7. 13
      web_app_drawer/views/web.xml

2
web_app_drawer/README.rst

@ -39,6 +39,8 @@ Known issues / Roadmap
* Provide keyboard navigation to secondary (top) menu * Provide keyboard navigation to secondary (top) menu
* Drag drawer from left to open in mobile * Drag drawer from left to open in mobile
* Figure out how to test focus on hidden elements for keyboard nav tests * Figure out how to test focus on hidden elements for keyboard nav tests
* If you resize the window, body gets a wrong ``overflow: auto`` css property
and you need to refresh your view or open/close the app drawer to fix that.
Bug Tracker Bug Tracker
=========== ===========

2
web_app_drawer/static/src/js/web_app_drawer.js

@ -172,6 +172,8 @@ odoo.define('web_app_drawer', function(require) {
core.bus.trigger('drawer.closed'); core.bus.trigger('drawer.closed');
this.$el.one('drawer.opened', $.proxy(this.onDrawerOpen, this)); this.$el.one('drawer.opened', $.proxy(this.onDrawerOpen, this));
this.isOpen = false; this.isOpen = false;
// Remove inline style inserted by drawer.js
this.$el.css("overflow", "");
}, },
/* It finds app links and register event handlers /* It finds app links and register event handlers

11
web_app_drawer/static/src/less/app_drawer.less

@ -13,13 +13,11 @@
background-clip: padding-box; background-clip: padding-box;
.navbar-left { .navbar-left {
width: 100%; width: 100%;
li { li {
padding: 0; padding: 0;
} }
} }
.app-drawer-title { .app-drawer-title {
@ -31,9 +29,12 @@
} }
.app-drawer-icon-app { .app-drawer-icon-app {
height: @app-drawer-icon-size;
width: @app-drawer-icon-size;
margin: @app-drawer-icon-margin;
height: 100%;
width: 100%;
max-width: @app-drawer-icon-size;
max-height: @app-drawer-icon-size;
object-fit: contain;
object-position: center;
} }
.panel-body { .panel-body {

10
web_app_drawer/static/src/less/main.less

@ -4,6 +4,16 @@
body { body {
width: 100%; width: 100%;
height: 100%; height: 100%;
// Do not fix the search part, it's too big for small screens
@media (max-width: @screen-sm-max) {
overflow: inherit;
.openerp {
.oe-view-manager {
overflow: inherit;
}
}
}
} }
main { main {

7
web_app_drawer/static/src/less/navbar.less

@ -27,12 +27,7 @@ a.navbar-collapse.collapse {
overflow-x: hidden; overflow-x: hidden;
} }
.badge {
position: absolute;
right: @app-drawer-padding-horizontal;
}
@media (max-width: @screen-sm - 1px) {
@media (max-width: @screen-xs-max) {
#odooMenuBarNav[aria-expanded="false"] { #odooMenuBarNav[aria-expanded="false"] {
/* Hack to hide the visibly expanded mobile menu on load. */ /* Hack to hide the visibly expanded mobile menu on load. */
position: absolute; position: absolute;

4
web_app_drawer/static/src/less/variables.less

@ -2,14 +2,12 @@
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */ * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
// App Drawer / Icons // App Drawer / Icons
@app-drawer-icon-size: 7em;
@app-drawer-icon-size: 6em;
@app-drawer-icon-margin: 1em; @app-drawer-icon-margin: 1em;
@app-drawer-width: 80%; @app-drawer-width: 80%;
@app-drawer-title-height: @navbar-height; @app-drawer-title-height: @navbar-height;
// Navbar // Navbar
@app-drawer-navbar-height: @navbar-height / 2; @app-drawer-navbar-height: @navbar-height / 2;
@app-drawer-navbar-padding-vertical: @navbar-padding-vertical / 2; @app-drawer-navbar-padding-vertical: @navbar-padding-vertical / 2;
@app-drawer-padding-horizontal: @navbar-padding-horizontal / 2; @app-drawer-padding-horizontal: @navbar-padding-horizontal / 2;

13
web_app_drawer/views/web.xml

@ -41,7 +41,7 @@
<div class="navbar-header"> <div class="navbar-header">
<a href="#" <a href="#"
class="drawer-toggle pull-left navbar-collapse collapse btn btn-default app-drawer-toggle"
class="drawer-toggle navbar-collapse collapse btn btn-default app-drawer-toggle"
accesskey="A" accesskey="A"
> >
<span class="sr-only">Toggle App Drawer</span> <span class="sr-only">Toggle App Drawer</span>
@ -52,7 +52,7 @@
class="app-drawer-toggle drawer-toggle pull-left navbar-toggle collapsed" class="app-drawer-toggle drawer-toggle pull-left navbar-toggle collapsed"
> >
<span class="sr-only">Toggle App Drawer</span> <span class="sr-only">Toggle App Drawer</span>
<i class="fa fa-th fa-lg app-drawer-icon-open" />
<div class="fa fa-th fa-lg app-drawer-icon-open" />
</button> </button>
<button type="button" <button type="button"
@ -214,8 +214,10 @@
</h4> </h4>
</div> </div>
<div class="panel-body" id="appDrawerAppPanelBody"> <div class="panel-body" id="appDrawerAppPanelBody">
<ul class="nav navbar-nav navbar-left oe_application_menu_placeholder" style="display: none;">
<li t-foreach="menu_data['children']" t-as="menu" class="col-xs-6 col-sm-4 col-md-3 col-lg-2 text-center">
<ul class="row list-unstyled oe_application_menu_placeholder"
style="display: none;">
<li t-foreach="menu_data['children']" t-as="menu"
class="col-xs-6 col-sm-4 col-md-3 col-lg-2 text-center mt16">
<t t-call="web.menu_link"> <t t-call="web.menu_link">
<t t-set="display_images" t-value="1" /> <t t-set="display_images" t-value="1" />
</t> </t>
@ -227,10 +229,7 @@
</ul> </ul>
</div> </div>
</div> </div>
</xpath> </xpath>
</template> </template>
</odoo> </odoo>
Loading…
Cancel
Save