mirror of https://github.com/OCA/web.git
[IMP] web_responsive: AppMenu wait for load view
parent
220fed1f79
commit
82ca2888b8
|
@ -1,6 +1,29 @@
|
|||
/* Copyright 2018 Tecnativa - Jairo Llopis
|
||||
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
|
||||
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
.o-app-icon-waiting {
|
||||
animation: 1.3s infinite cubic-bezier(.65,.05,.36,1) o-app-icon-bounce-animation;
|
||||
}
|
||||
|
||||
@mixin full-screen-dropdown {
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
odoo.define('web_responsive', function (require) {
|
||||
'use strict';
|
||||
|
||||
var ActionManager = require('web.ActionManager');
|
||||
var AbstractWebClient = require("web.AbstractWebClient");
|
||||
var AppsMenu = require("web.AppsMenu");
|
||||
var config = require("web.config");
|
||||
|
@ -264,6 +265,14 @@ odoo.define('web_responsive', function (require) {
|
|||
},
|
||||
});
|
||||
},
|
||||
|
||||
// Load view indicator
|
||||
_onAppsMenuItemClicked: function (ev) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
$(ev.currentTarget).find('img').addClass('o-app-icon-waiting');
|
||||
this._super.apply(this, arguments);
|
||||
},
|
||||
});
|
||||
|
||||
Menu.include({
|
||||
|
@ -358,7 +367,24 @@ odoo.define('web_responsive', function (require) {
|
|||
} else {
|
||||
this._super.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
// Hide AppMenu & remove waiting anim when loaded action
|
||||
ActionManager.include({
|
||||
doAction: function () {
|
||||
return this._super.apply(this, arguments).then(function () {
|
||||
var $app_menu = $('.o_menu_apps .dropdown');
|
||||
if ($app_menu.length) {
|
||||
if ($app_menu.hasClass('show')) {
|
||||
$app_menu.dropdown('toggle');
|
||||
}
|
||||
|
||||
$app_menu.find('img.o-app-icon-waiting').removeClass(
|
||||
'o-app-icon-waiting');
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue