Skip to content

Commit

Permalink
Merge pull request #741 from modos189/fix/accesskey
Browse files Browse the repository at this point in the history
Fix accessKey in Toolbox API
  • Loading branch information
modos189 authored Aug 11, 2024
2 parents 199c9f7 + e9770ef commit ab3ae12
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 ab3ae12

Please sign in to comment.