Browse Source

[IMP] web_responsive: Suggested changes

pull/1279/merge
Alexandre Díaz 6 years ago
committed by OCA-git-bot
parent
commit
097bbcc1e4
  1. 4
      web_responsive/readme/DESCRIPTION.rst
  2. BIN
      web_responsive/static/img/appmenu.gif
  3. 91
      web_responsive/static/src/css/web_responsive.scss
  4. 26
      web_responsive/static/src/js/web_responsive.js

4
web_responsive/readme/DESCRIPTION.rst

@ -59,3 +59,7 @@ Features for computers:
* Sticky chatter topbar * Sticky chatter topbar
.. image:: ./static/img/chatter_topbar.gif .. image:: ./static/img/chatter_topbar.gif
* AppMenu waits for action finished to show the view
.. image:: ./static/img/appmenu.gif

BIN
web_responsive/static/img/appmenu.gif

After

Width: 1410  |  Height: 768  |  Size: 710 KiB

91
web_responsive/static/src/css/web_responsive.scss

@ -2,26 +2,25 @@
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */ * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
// AppMenu icon waiting indicator anim // AppMenu icon waiting indicator anim
@keyframes o-app-icon-bounce-animation {
0% {
transform-origin: bottom center;
}
25% {
transform: translateY(-20px);
}
50% {
transform: translateY(0px);
}
75% {
transform: translateY(-10px);
}
100% {
transform: translateY(0);
transform-origin: bottom center;
}
@keyframes o-app-icon-flash-animation {
0% {
filter: brightness(1.0);
}
25% {
filter: brightness(2.0);
}
50% {
filter: brightness(1.0);
}
75% {
filter: brightness(2.0);
}
100% {
filter: brightness(1.0);
}
} }
.o-app-icon-waiting {
animation: 1.3s infinite cubic-bezier(.65,.05,.36,1) o-app-icon-bounce-animation;
.o-app-waiting img {
animation: 1.3s infinite cubic-bezier(.65,.05,.36,1) o-app-icon-flash-animation;
} }
@mixin full-screen-dropdown { @mixin full-screen-dropdown {
@ -349,32 +348,6 @@ html .o_web_client .o_main .o_main_content {
.o_content, .modal-content { .o_content, .modal-content {
max-width: 100%; max-width: 100%;
// Sticky Header & Footer in List View
>div {
>.table-responsive {
overflow-x: initial;
>.o_list_view {
// th & td are here for compatibility with chrome
thead, thead tr:nth-child(1) th {
position: sticky;
top: 0;
z-index: 1;
}
thead tr:nth-child(1) th {
background-color: $o-list-footer-bg-color;
}
tfoot, tfoot tr:nth-child(1) td {
position: sticky;
bottom: 0;
}
tfoot tr:nth-child(1) td {
background-color: $o-list-footer-bg-color;
}
}
}
}
// Form views // Form views
.o_form_view { .o_form_view {
.o_form_sheet { .o_form_sheet {
@ -392,14 +365,14 @@ html .o_web_client .o_main .o_main_content {
.oe_title { .oe_title {
width: initial; width: initial;
>h1>span {
span {
max-width: 100%; max-width: 100%;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
width: initial; width: initial;
} }
>h1>span:active {
span:active {
white-space: normal; white-space: normal;
} }
} }
@ -532,3 +505,27 @@ html .o_web_client .o_main .o_main_content {
} }
} }
} }
// Sticky Header & Footer in List View
.table-responsive {
overflow-x: initial;
.o_list_view {
// th & td are here for compatibility with chrome
thead, thead tr:nth-child(1) th {
position: sticky;
top: 0;
z-index: 1;
}
thead tr:nth-child(1) th {
background-color: $o-list-footer-bg-color;
}
tfoot, tfoot tr:nth-child(1) td {
position: sticky;
bottom: 0;
}
tfoot tr:nth-child(1) td {
background-color: $o-list-footer-bg-color;
}
}
}

26
web_responsive/static/src/js/web_responsive.js

@ -270,7 +270,12 @@ odoo.define('web_responsive', function (require) {
_onAppsMenuItemClicked: function (ev) { _onAppsMenuItemClicked: function (ev) {
ev.preventDefault(); ev.preventDefault();
ev.stopPropagation(); ev.stopPropagation();
$(ev.currentTarget).find('img').addClass('o-app-icon-waiting');
// Prevents anim more app-icon if user click other before action
// is fully loaded
this.$el.find('.o-app-waiting').removeClass(
'o-app-waiting');
$(ev.currentTarget).addClass('o-app-waiting');
document.body.style.cursor = 'progress';
this._super.apply(this, arguments); this._super.apply(this, arguments);
}, },
}); });
@ -372,16 +377,23 @@ odoo.define('web_responsive', function (require) {
// Hide AppMenu & remove waiting anim when loaded action // Hide AppMenu & remove waiting anim when loaded action
ActionManager.include({ ActionManager.include({
doAction: function () {
doAction: function (action, options) {
return this._super.apply(this, arguments).then(function () { return this._super.apply(this, arguments).then(function () {
var $app_menu = $('.o_menu_apps .dropdown'); var $app_menu = $('.o_menu_apps .dropdown');
if ($app_menu.length) {
if ($app_menu.hasClass('show')) {
$app_menu.dropdown('toggle');
if ($app_menu.length && options &&
'action_menu_id' in options) {
var $app = $app_menu.find('.o_app.active');
var menu_id = $app.data('menuId');
if (menu_id === options.action_menu_id) {
if ($app_menu.hasClass('show')) {
$app_menu.dropdown('toggle');
}
document.body.style.cursor = 'default';
$app_menu.find('.o-app-waiting').removeClass(
'o-app-waiting');
} }
$app_menu.find('img.o-app-icon-waiting').removeClass(
'o-app-icon-waiting');
} }
}); });
}, },

Loading…
Cancel
Save