mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 12:39:25 +01:00
* Mail - Add keyboard actions for forward & reply in the list, and send in compose
This commit is contained in:
parent
2078025eea
commit
5daf70535f
@ -122,6 +122,7 @@ class mail_compose
|
||||
'group' => ++$group,
|
||||
'onExecute' => 'javaScript:app.mail.compose_submitAction',
|
||||
'hint' => 'Send',
|
||||
'shortcut' => array('ctrl' => true, 'keyCode' => 83, 'caption' => 'Ctrl + S'),
|
||||
'toolbarDefault' => true
|
||||
),
|
||||
'pgp' => array(
|
||||
|
@ -1115,6 +1115,7 @@ class mail_ui
|
||||
'group' => $group,
|
||||
'onExecute' => 'javaScript:app.mail.mail_compose',
|
||||
'allowOnMultiple' => false,
|
||||
'shortcut' => array('ctrl' => true, 'shift' => true, 'keyCode' => 65, 'caption' => 'Ctrl + Shift + A'),
|
||||
),
|
||||
'forward' => array(
|
||||
'caption' => 'Forward',
|
||||
@ -1128,6 +1129,7 @@ class mail_ui
|
||||
'hint' => 'forward inline',
|
||||
'onExecute' => 'javaScript:app.mail.mail_compose',
|
||||
'allowOnMultiple' => false,
|
||||
'shortcut' => array('ctrl' => true, 'keyCode' => 70, 'caption' => 'Ctrl + F'),
|
||||
'toolbarDefault' => true
|
||||
),
|
||||
'forwardasattach' => array(
|
||||
|
@ -284,6 +284,8 @@ app.classes.mail = AppJS.extend(
|
||||
}
|
||||
that.compose_resizeHandler();
|
||||
});
|
||||
// Init key handler
|
||||
this.init_keyHandler();
|
||||
|
||||
//Call drag_n_drop initialization for emails on compose
|
||||
this.init_dndCompose();
|
||||
@ -4743,6 +4745,31 @@ app.classes.mail = AppJS.extend(
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Keyhandler for compose window
|
||||
* Use this one so we can handle keys even on inputs
|
||||
*/
|
||||
init_keyHandler: function()
|
||||
{
|
||||
jQuery(document).on('keydown', function(e) {
|
||||
// Translate the given key code and make it valid
|
||||
var keyCode = e.which;
|
||||
keyCode = egw_keycode_translation_function(keyCode);
|
||||
keyCode = egw_keycode_makeValid(keyCode);
|
||||
|
||||
// Only go on if this is a valid key code - call the key handler
|
||||
if (keyCode != -1)
|
||||
{
|
||||
if (egw_keyHandler(keyCode, e.shiftKey, e.ctrlKey || e.metaKey, e.altKey))
|
||||
{
|
||||
// If the key handler successfully passed the key event to some
|
||||
// sub component, prevent the default action
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialize dropping targets for draggable emails
|
||||
* -
|
||||
|
Loading…
Reference in New Issue
Block a user