From e9770ef82089af81bb962e9c61141c18cc345b76 Mon Sep 17 00:00:00 2001 From: Alexander Danilov Date: Thu, 20 Jun 2024 11:31:04 +0500 Subject: [PATCH] Fix accessKey in Toolbox API Added name aliases for backward compatibility --- core/code/toolbox.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/code/toolbox.js b/core/code/toolbox.js index 478af9419..5d9ce5092 100644 --- a/core/code/toolbox.js +++ b/core/code/toolbox.js @@ -14,7 +14,7 @@ * @property {Function|undefined} action - The onclick action for the button. * @property {string|null} [class] - Optional. The class(es) for the button. * @property {string|null} [title] - Optional. The title (tooltip) for the button. - * @property {string|null} [access_key] - Optional. The access key for the button. + * @property {string|null} [accessKey] - Optional. The access key for the button. * @property {Function|null} [mouseover] - Optional. The mouseover event for the button. * @property {string|null} [icon] - Optional. Icon name from FontAwesome for the button. */ @@ -126,6 +126,8 @@ IITC.toolbox = { if (typeof buttonData.title === 'string') buttonElement.title = buttonData.title; if (typeof buttonData.class === 'string') buttonElement.className = buttonData.class; if (typeof buttonData.access_key === 'string') buttonElement.accessKey = buttonData.access_key; + if (typeof buttonData.accesskey === 'string') buttonElement.accessKey = buttonData.accesskey; + if (typeof buttonData.accessKey === 'string') buttonElement.accessKey = buttonData.accessKey; if (typeof buttonData.mouseover === 'function') buttonElement.onmouseover = buttonData.mouseover; if (typeof buttonData.icon === 'string') { @@ -201,7 +203,7 @@ IITC.toolbox = { action: () => node.click(), class: node.className, title: node.title, - access_key: node.accessKey, + accessKey: node.accessKey, mouseover: node.mouseover, icon: iconClass, };