Browse Source

fixup! fixup! fixup! [ADD] Backport functionality from 12.0 to web_keyboard_navigation module.

pull/1119/head
George Daramouskas 6 years ago
parent
commit
03bce7eaed
No known key found for this signature in database GPG Key ID: 5B4EF742F8CD859C
  1. 21
      web_keyboard_navigation/README.rst
  2. 11
      web_keyboard_navigation/static/src/js/web_keyboard_navigation.js

21
web_keyboard_navigation/README.rst

@ -6,22 +6,23 @@
web_keyboard_navigation web_keyboard_navigation
============================== ==============================
This module was written to extend the functionality of ... to support ...
and allow you to ...
This module was written to extend the functionality of the Web Client to
support easier navigation and allow you to use the Alt key in order to get
some shortcuts shown on your client.
Installation Installation
============ ============
To install this module, you need to: To install this module, you need to:
#. do this ...
Follow the usual procedure for your version of Odoo.
Configuration Configuration
============= =============
To configure this module, you need to: To configure this module, you need to:
#. go to ...
No configuration can take place at this point.
Usage Usage
===== =====
@ -32,18 +33,12 @@ To use this module, you need to:
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot :alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/162 :target: https://runbot.odoo-community.org/runbot/162
163
164
186
210
225
258/11.0
Known issues / Roadmap Known issues / Roadmap
====================== ======================
* None
* Allow customization of the keys.
Bug Tracker Bug Tracker
=========== ===========
@ -82,3 +77,7 @@ mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.
To contribute to this module, please visit https://odoo-community.org. To contribute to this module, please visit https://odoo-community.org.
**This module is a backport from Odoo SA and as such, it is not included in the
OCA CLA. That means we do not have a copy of the copyright on it like all other
OCA modules.

11
web_keyboard_navigation/static/src/js/web_keyboard_navigation.js

@ -22,7 +22,7 @@ odoo.define('web_keyboard_navigation.KeyboardNavigationMixin', function (
'E', 'E',
'F', 'F',
'D', 'D',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
]; ];
var KeyboardNavigationMixin = { var KeyboardNavigationMixin = {
@ -32,7 +32,7 @@ odoo.define('web_keyboard_navigation.KeyboardNavigationMixin', function (
}, },
init: function () { init: function () {
this._super()
this._super();
this._areAccessKeyVisible = false; this._areAccessKeyVisible = false;
this.BrowserDetection = new BrowserDetection(); this.BrowserDetection = new BrowserDetection();
}, },
@ -44,7 +44,7 @@ odoo.define('web_keyboard_navigation.KeyboardNavigationMixin', function (
var overlay = $(_.str.sprintf( var overlay = $(_.str.sprintf(
"<div class='o_web_accesskey_overlay'>%s</div>", "<div class='o_web_accesskey_overlay'>%s</div>",
$(elem).attr('accesskey').toUpperCase())); $(elem).attr('accesskey').toUpperCase()));
var $overlayParent;
var $overlayParent = null;
if (elem.tagName.toUpperCase() === "INPUT") { if (elem.tagName.toUpperCase() === "INPUT") {
$overlayParent = $(elem).parent(); $overlayParent = $(elem).parent();
} else { } else {
@ -134,8 +134,9 @@ odoo.define('web_keyboard_navigation.KeyboardNavigationMixin', function (
}); });
this._addAccessKeyOverlays(); this._addAccessKeyOverlays();
} }
if (this.BrowserDetection.isOsMac())
if (this.BrowserDetection.isOsMac()) {
return; return;
}
if (keyDownEvent.altKey && if (keyDownEvent.altKey &&
!keyDownEvent.ctrlKey && !keyDownEvent.ctrlKey &&
keyDownEvent.key.length === 1) { keyDownEvent.key.length === 1) {
@ -170,7 +171,7 @@ odoo.define('web_keyboard_navigation.KeyboardNavigationMixin', function (
} }
} }
else { else {
var numberKey;
var numberKey = null;
if (keyDownEvent.originalEvent.code && if (keyDownEvent.originalEvent.code &&
keyDownEvent.originalEvent.code.indexOf( keyDownEvent.originalEvent.code.indexOf(
'Digit') === 0) { 'Digit') === 0) {

Loading…
Cancel
Save