Grid and nextmatch aoi now reset the input element focus once a row is clicked

This commit is contained in:
Andreas Stöckel 2011-06-16 20:43:33 +00:00
parent 41c4d4cee4
commit f3ccd96f03
4 changed files with 40 additions and 0 deletions

View File

@ -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;

View File

@ -113,6 +113,14 @@ function egwResetPreventSelect(elem)
{
}
function egwUnfocus()
{
if (document.activeElement)
{
document.activeElement.blur();
}
}
function egwCallAbstract(_obj, _fn, _args)
{

View File

@ -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;
}

View File

@ -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)
{