From be57f2a37bfbdaabfb44f836f39bd48e9105c1e2 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 30 Jun 2011 12:43:04 +0000 Subject: [PATCH] new standard action to active the first link in a row, fixed numeric id's det Del shortcut --- etemplate/inc/class.nextmatch_widget.inc.php | 4 +++- etemplate/js/nextmatch_action.js | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/etemplate/inc/class.nextmatch_widget.inc.php b/etemplate/inc/class.nextmatch_widget.inc.php index ec63a6bb6e..e405136a62 100644 --- a/etemplate/inc/class.nextmatch_widget.inc.php +++ b/etemplate/inc/class.nextmatch_widget.inc.php @@ -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); } diff --git a/etemplate/js/nextmatch_action.js b/etemplate/js/nextmatch_action.js index c6be78506a..f24f1cc3c1 100644 --- a/etemplate/js/nextmatch_action.js +++ b/etemplate/js/nextmatch_action.js @@ -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; + } +}