mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-01 23:24:12 +01:00
N°3524 Add keyboard shortcuts to global actions
This commit is contained in:
@@ -21,6 +21,7 @@ namespace Combodo\iTop\Application\UI\Base\Component\QuickCreate;
|
||||
|
||||
|
||||
use Combodo\iTop\Application\UI\Base\UIBlock;
|
||||
use iKeyboardShortcut;
|
||||
use MetaModel;
|
||||
use UserRights;
|
||||
use utils;
|
||||
@@ -33,7 +34,7 @@ use utils;
|
||||
* @internal
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class QuickCreate extends UIBlock
|
||||
class QuickCreate extends UIBlock implements iKeyboardShortcut
|
||||
{
|
||||
// Overloaded constants
|
||||
public const BLOCK_CODE = 'ibo-quick-create';
|
||||
@@ -201,4 +202,14 @@ class QuickCreate extends UIBlock
|
||||
{
|
||||
return $this->iMaxHistoryResults;
|
||||
}
|
||||
|
||||
public static function GetShortcutKeys(): array
|
||||
{
|
||||
return [['id' => 'ibo-open-quick-create', 'label' => 'UI:Component:QuickCreate:KeyboardShortcut:OpenDrawer', 'key' => 'c', 'event' => 'open_drawer']];
|
||||
}
|
||||
|
||||
public static function GetShortcutTriggeredElementSelector(): string
|
||||
{
|
||||
return "[data-role='".static::BLOCK_CODE."']";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user