new standard action to active the first link in a row, fixed numeric id's det Del shortcut

This commit is contained in:
Ralf Becker 2011-06-30 12:43:04 +00:00
parent 51c6e79475
commit be57f2a37b
2 changed files with 23 additions and 1 deletions

View File

@ -618,6 +618,8 @@ class nextmatch_widget
'print'=> 'print',
'copy' => 'copy',
'move' => 'move',
'cut' => 'cut',
'paste'=> 'editpaste',
);
$first_level = !$action_links; // add all first level actions
@ -731,7 +733,7 @@ class nextmatch_widget
}
// give all delete actions a delete shortcut
if ($id == 'delete' && !isset($action['shortcut']))
if ($id === 'delete' && !isset($action['shortcut']))
{
$action['shortcut'] = egw_keymanager::shortcut(egw_keymanager::DELETE);
}

View File

@ -335,3 +335,23 @@ function nm_hide_popup(element, div_id)
return false;
}
/**
* Activate/click first link in row
*/
function nm_activate_link(_action, _senders)
{
// $(_senders[0].iface.getDOMNode()).find('a:first').trigger('click'); not sure why this is NOT working
var a_href = $(_senders[0].iface.getDOMNode()).find('a:first');
if (typeof a_href != undefined)
{
var target = a_href.attr('target');
var href = a_href.attr('href');
if (target)
window.open(href,target);
else
window.location = href;
}
}