summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/abstract_controller.js
diff options
context:
space:
mode:
authorJulien Mougenot <jum@odoo.com>2019-07-12 09:25:16 +0000
committerJulien Mougenot <jum@odoo.com>2019-08-16 09:03:49 +0000
commitbec84c10a1f683f9cc37e76d7fb354ed066508f4 (patch)
tree67b7805df8ea10e14fb52dd8c69c2e61bbbd7063 /addons/web/static/src/js/views/abstract_controller.js
parent0aea29da8db6821a021a705c68985d7d38d476b1 (diff)
[IMP] web: keyboard navigation between searchbar and renderer
This change allows direct keyboard navigation between the current action searchbar and renderer. Focus can now be toggled using DOWN arrow when focusing the searchbar or the UP arrow when focusing the top cell/record of a kanban or a list.
Diffstat (limited to 'addons/web/static/src/js/views/abstract_controller.js')
-rw-r--r--addons/web/static/src/js/views/abstract_controller.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/addons/web/static/src/js/views/abstract_controller.js b/addons/web/static/src/js/views/abstract_controller.js
index 07a0109e9a7..cb83301c14d 100644
--- a/addons/web/static/src/js/views/abstract_controller.js
+++ b/addons/web/static/src/js/views/abstract_controller.js
@@ -559,15 +559,19 @@ var AbstractController = mvc.Controller.extend(ActionMixin, {
ev.data.callback(state || {});
},
/**
- * Called mainly from the control panel when the focus should be given to
- * the controller
+ * Called either from the control panel to focus the controller
+ * or from the view to focus the search bar
*
* @private
* @param {OdooEvent} ev
*/
_onNavigationMove: function (ev) {
switch (ev.data.direction) {
- case 'down' :
+ case 'up':
+ ev.stopPropagation();
+ this._controlPanel.focusSearchBar();
+ break;
+ case 'down':
ev.stopPropagation();
this.giveFocus();
break;
@@ -629,7 +633,6 @@ var AbstractController = mvc.Controller.extend(ActionMixin, {
_onSwitchView: function (ev) {
ev.data.controllerID = this.controllerID;
},
-
});
return AbstractController;