diff --git a/etemplate/js/nextmatch_action.js b/etemplate/js/nextmatch_action.js index 607fce6efa..c6be78506a 100644 --- a/etemplate/js/nextmatch_action.js +++ b/etemplate/js/nextmatch_action.js @@ -45,6 +45,10 @@ function nextmatchRowAOI(_node, _selectMode) // Now append some action code to the node selectHandler = function(e) { + // Reset the focus so that keyboard navigation will work properly + // after the element has been clicked + egwUnfocus(); + // Reset the prevent selection code (in order to allow wanted // selection of text) _node.onselectstart = null; diff --git a/phpgwapi/js/egw_action/egw_action_common.js b/phpgwapi/js/egw_action/egw_action_common.js index cbf5643cdf..b93b243028 100644 --- a/phpgwapi/js/egw_action/egw_action_common.js +++ b/phpgwapi/js/egw_action/egw_action_common.js @@ -113,6 +113,14 @@ function egwResetPreventSelect(elem) { } +function egwUnfocus() +{ + if (document.activeElement) + { + document.activeElement.blur(); + } +} + function egwCallAbstract(_obj, _fn, _args) { diff --git a/phpgwapi/js/egw_action/egw_action_popup.js b/phpgwapi/js/egw_action/egw_action_popup.js index e7adcc4c95..a49f3ce791 100644 --- a/phpgwapi/js/egw_action/egw_action_popup.js +++ b/phpgwapi/js/egw_action/egw_action_popup.js @@ -28,6 +28,7 @@ function egwPopupAction(_id, _handler, _caption, _icon, _onExecute, _allowOnMult action.checkbox = false; action.radioGroup = 0; action.checked = false; + action.shortcut = null; action.set_default = function(_value) { action["default"] = _value; @@ -60,6 +61,30 @@ function egwPopupAction(_id, _handler, _caption, _icon, _onExecute, _allowOnMult action.radioGroup = _value; } + action.set_shortcut = function(_value) { + var sc = { + "keyCode": -1, + "shift": false, + "ctrl": false, + "alt": false + } + + if (typeof _value == "number") + { + sc.keyCode = _value; + } + + if (typeof _value == "object" && _value.keyCode != "undefined") + { + sc.keyCode = _value.keyCode; + sc.shift = (typeof _value.shift == "undefined") ? false : _value.shift; + sc.ctrl = (typeof _value.ctrl == "undefined") ? false : _value.ctrl; + sc.alt = (typeof _value.shift == "undefined") ? false : _value.alt; + } + + this.shortcut = null; + } + return action; } diff --git a/phpgwapi/js/egw_action/egw_grid_view.js b/phpgwapi/js/egw_action/egw_grid_view.js index b8894df5ca..61423d1e8c 100644 --- a/phpgwapi/js/egw_action/egw_grid_view.js +++ b/phpgwapi/js/egw_action/egw_grid_view.js @@ -1565,6 +1565,9 @@ function egwGridViewRow_doInsertIntoDOM() else { td.click({"item": this, "col": col.id}, function(e) { + // Reset the browser focus, so that key navigation will work + // properly + egwUnfocus(); this.onselectstart = null; if (!e.data.item.checkbox || this != e.data.item.checkbox.context) {