Skip to content

Commit

Permalink
Fix accessKey in Toolbox API
Browse files Browse the repository at this point in the history
Added name aliases for backward compatibility
  • Loading branch information
modos189 committed Jun 20, 2024
1 parent 199c9f7 commit e9770ef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/code/toolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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,
};
Expand Down

0 comments on commit e9770ef

Please sign in to comment.